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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
I can tweak it so that we do register the equivalence with ranger by
reprocessing statements after a successful simplify or fold:

=========== BB 3 ============
a_2(D)  signed char [-INF, -1]
Equivalence set : [a_2(D), v_4]
    <bb 3> :
    v_4 = a_2(D);

v_4 : signed char [-INF, -1]

=========== BB 4 ============
    <bb 4> :
    # v_1 = PHI <a_2(D)(2), v_4(3)>

but it doesn't buy us much on its own.

Later passes propagate a_2 into the PHI and then fold the PHI into a copy
regardless.

We could in theory do that in EVRP too, but it seems like something copy
propagation or PHI-opt would handle more naturally.  The arguments can come
from an arbitrary list of equivalences and yet resolve to the same value... but
we need to pick the right one.  

That said, its probably worth getting the equivalence added because that could
be useful in other ways too.

Reply via email to