Move some bit and binary optimizations in simplify and match

Richard Biener richard.guenther@gmail.com
Mon Oct 26 09:33:00 GMT 2015


On Mon, Oct 26, 2015 at 10:26 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Sat, Oct 24, 2015 at 11:15 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>> On Fri, 23 Oct 2015, Hurugalawadi, Naveen wrote:
>>
>> + (minus (bit_and:cs @0 (bit_not @1)) (bit_and:s @0 @1))
>>
>> I am not sure why we have :c on one bit_and but not the other.
>
> Clearly an omission.
>
>> + (bit_ior:c (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
>>
>> Here on the other hand, I believe the :c on bit_ior is redundant.
>
> Yes.  It's somewhat twisty ;)  I wonder why it doesn't get you a genmatch
> warning for duplicate patterns though.  A it does:
>
> test.pd:2:3 warning: duplicate pattern
>  (bit_ior:c (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
>   ^
> test.pd:2:3 warning: previous pattern defined here
>  (bit_ior:c (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
>   ^
> (BIT_IOR_EXPR (BIT_AND_EXPR (BIT_NOT_EXPR @0) @1) (BIT_AND_EXPR @0
> (BIT_NOT_EXPR @1)))
>
> so please watch out for them when building.

I'm testing a patch to fix both issues.

Richard.

> Richard.
>
>>
>> --
>> Marc Glisse



More information about the Gcc-patches mailing list