On October 15, 2015 1:55:09 AM GMT+02:00, Jan Hubicka <hubi...@ucw.cz> wrote: >> On October 14, 2015 6:27:02 PM GMT+02:00, Jan Hubicka ><hubi...@ucw.cz> wrote: >> >Hi, >> >this patch adds the CONSTRUCTOR case discussed while back. Only >empty >> >constructors are matched, as those are only appearing in gimple >> >operand. >> >I tested that during bootstrap about 7500 matches are for empty >ctors. >> >There are couple hundred for non-empty probably used on generic. >> > >> >Bootstrapped/regtested x86_64-linux, OK? >> > >> >Honza >> > >> > * fold-const.c (operand_equal_p): Match empty constructors. >> >Index: fold-const.c >> >=================================================================== >> >--- fold-const.c (revision 228735) >> >+++ fold-const.c (working copy) >> >@@ -2890,6 +2891,11 @@ operand_equal_p (const_tree arg0, const_ >> > return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, >> >0), >> > flags | OEP_ADDRESS_OF >> > | OEP_CONSTANT_ADDRESS_OF); >> >+ case CONSTRUCTOR: >> >+ /* In GIMPLE empty constructors are allowed in initializers of >> >+ vector types. */ >> >> The comment is wrong (or at least odd), >> On gimple an empty vector constructor should be folded to a >VECTOR_CST. > >Hmm, I tought we have a={} i.e. for clearing whole structure.
Yes we do, but then the comment should refer to aggregate types. >If we never have constructors appearing as gimple operands, I guess we >don't >really need the code at gimple level (because at least so far ipa-icf >has >separate path to compare constructors). > >Honza >> >> >+ return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0)) >> >+ && !vec_safe_length (CONSTRUCTOR_ELTS (arg1))); >> > default: >> > break; >> > } >>