This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tiny combine tweek


Jan Hubicka <jh@suse.cz> writes:

>> Wouldn't it be better to notice that the pair of shifts is a noop at
>> the time the IF_THEN_ELSE construct would otherwise be generated?
>
> That code is somewhat generic (what it does is to recursivly walk the
> RTL and try to convert these into if_then_elses - so it first creates if
> then else form of "a", then "a<<1" and so on).
>
> It would be possible to reorder the optimizations so first the normal
> simplification of shifts is done and later we do this trick, but it
> needs more changes too (the combine_simplify_rtx would need to not
> return out of each case of the large switch separately) and doing so
> this way can possibly catch some extra cases where such a noop
> if_then_else is constructed for different reasons...

Okay, in that case I'm willing to approve this patch.  Please try to
come up with a test case that can be put into the testsuite; I realize
this is difficult.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]