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

--- Comment #10 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Richard Biener from comment #9)
> I think the GCC 12 IL would require tracking equivalences on parts of
> registers,
> in this case that _2 is equal to the low part of a.0_1.  That is, one would
> need to extend what CCP does with bit propagation to include equivalences.
> 

I have in my workqueue some thoughts for GCC13 where we can track partial
equivalences so we can see through different casts and masks. 

    a.0_1 = a;
    _2 = (unsigned int) a.0_1;
    b = _2;
    _6 = a.0_1 & 4294967295;
    c_10 = _6;
    if (c_10 != 0)
      goto <bb 3>; [INV]

_2 would be a 32 bit equivalence with a.0_1 generated by op_cast, and
_6 would also be a 32 bit equivalence with a.0_1 generated  op_bitwise_and.
They would all end up in the same partial equivalence set.

and when a range for anything in that set falls into the bitrange of the
equivalence size,  like the [0,0] , then it can be applied (with some
restrictions), to other members of the set.   Its an extension of some thought
I had for trying to relates different size casts to each other, just extended
to include masking.


There is a series of other PRs which would be fixed by this sort of ability. it
has become prevalent enough to warrant the work I think. (Also 79191 91881
102705 102872)

Reply via email to