[Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (trunk vs 11.2.0)

law at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 18 15:28:59 GMT 2022


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

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
We thread one edge at a time, so we don't know ahead of time how many copies
there would be.

It could be restructured to go ahead and register these threads, then compute
the copy cost on a more global basis.  That would allow us to bump up the
threshold to register the thread, but still reject things later if the cost
appears to be too high.

The book keeping necessary to do that would actually be step #0 for the real
solution which would be to fix the new copier to coalesce cases where multiple
incoming edges thread to the same outgoing edge in a manner similar to what
tree-ssa-threadupdate does.


More information about the Gcc-bugs mailing list