[PATCH] Improve combining of conditionals
Maxim Kuvyrkov
maxim@codesourcery.com
Fri Apr 15 12:41:00 GMT 2011
On Apr 15, 2011, at 3:34 PM, Eric Botcazou wrote:
>> The problem this patch fixes is that combine_simplify_rtx() prefers to
>> return an expression (say, <xor (a) (b)>) even when a comparison is
>> prefered (say, <neq (xor (a) (b)) 0>). Expressions are not recognized as
>> valid conditions of if_then_else for most targets, so combiner misses a
>> potential optimization. This patch makes combine_simplify_rtx() aware of
>> the context it was invoked in, and, when appropriate, does not discourage
>> it from returning a conditional.
>
> Btw, this is very likely also valid for targets with STORE_FLAG_VALUE == -1 so
> the same IN_COND short-circuit would need to be added a few lines below in
> combine_simplify_rtx. But this would need to be tested. Do you happen to
> have access to such a target, e.g. m68k?
Hm, I didn't notice that one, thanks! I have access to m68k (ColdFire, tbp) and will test this change there before committing.
--
Maxim Kuvyrkov
Mentor Graphics / CodeSourcery
More information about the Gcc-patches
mailing list