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

--- Comment #15 from Jeffrey A. Law <law at redhat dot com> ---
Yea, I just looked and it's somewhat painful to do because of how threading
works.  We walk statements forward and stop when we hit the limit.  But DCE
analysis is easier to formulate as a backwards walk.

We could probably pre-compute it at the start of pass as the property we're
looking for is most likely unchanged within the pass.  That would allow us to
query it during the forward walk through the block.   In fact, I think if we do
that, we don't have to keep the STMT_COUNT stuff at all.  We pre-compute the
cost of the copying the block.  If it's too large, we mark the block as not
copyable for jump threading.  Then we just query that property rather than
counting statements within block processing.

I'd almost prefer to defer that until gcc-9.

I think we probably could twiddle record_temporary_equivalences_from_phis to
not bump STMT_COUNT for a 2 argument PHI to address this BZ in the immediate
term.

Reply via email to