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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-06-22

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Hongtao Liu from comment #5)
> > The initilization of 0 is very cheap, not sure if it's worth to do uncprop
> > for it.
> 
> Or maybe we should prevent propgate a single-use SSA-NAME into a PHI since
> it extends the live range plus hurt backend optimization for cmp.

uncprop should be integrated with out-of-SSA coalescing because it's exactly
done
to create coalescing opportunities in PHIs (avoiding edge splitting and
insertion of constant initialization).  But when the value does not get
coalesced we should "undo" the un-cpropagation.  So somehow just record
the equivalence for the purpose of coalescing and commit to it after
coalescing is done.

This is a long-term item from my TODO / wishlist.

I think a single-use heuristic isn't good, a heuristic based on the cost
of materializing a constant might be, but you have to consider an extra
unconditional jump eventually as well.

Reply via email to