https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101808

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-06
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am going to try to fix this.
A simple thing like this might work (I am going to reuse gimple_truth in other
places too):
#if GIMPLE
(match gimple_truth SSA_NAME@0
 (if (get_nonzero_bits (@0) == 1)))


(simplify
 (lt gimple_truth@0 gimple_truth@1)
 (bit_and (xor! @0 { build_one_cst (type); }) @1)

(simplify
 (le gimple_truth@0 gimple_truth@1)
 (bit_or (xor! @0 { build_one_cst (type); }) @1)

(simplify
 (gt gimple_truth@0 gimple_truth@1)
 (bit_and (xor! @1 { build_one_cst (type); }) @0)

(simplify
 (ge gimple_truth@0 gimple_truth@1)
 (bit_or (xor! @1 { build_one_cst (type); }) @0)
#endif

I have never used the ! in match-and-simplify before either.

Reply via email to