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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2025-06-04

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Unfortunately I'm not seeing any pattern we can really target.  We're looking
at a 3 insn combination here.  We need both source arguments to be substituted
into the AND so that we know we're only dealing with 0/1.

combine does the substitution for the equality test, but not the output of the
slt.  So the closest we get to a useful combine step is:

Failed to match this instruction:
(set (reg:SI 181)
    (and:SI (eq:SI (reg:SI 175)
            (const_int -1 [0xffffffffffffffff]))
        (reg:SI 135 [ _2 ])))


Maybe we could do something in match.pd.  I haven't really looked to see if
that's a viable path or whether or not the result meets the gimple costing
conditions.

At least in gimple we know the types are single bit which simplifies the
problem a bit.

The other thought would be look at the expansion code itself.  But I'm hesitant
to put any special code in there.

Sigh.  At least right now I don't see a direct path forward.

Reply via email to