https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128483
--- Comment #3 from Reshma Roy <Reshma.Roy at amd dot com> --- (In reply to Richard Biener from comment #2) > IMO a better fix would be to use LCM to common/place the CSEd loads since > that would avoid placing loads where it would be possibly not executed > before (so it avoids speculation). Unless speculating the loads was > intended. I agree. But from my understanding from the pass, it looks like the speculative load was intended. There is the following comment in the pass right before the function where the cse happens as below: "NB: We want to generate a pattern, which is executed only once, to cover the whole function. The LCM algorithm isn't appropriate here since it may place a pattern inside the loop. */" Hence, I am confused how we should approach this problem. > > Dominators are already computed later, don't do it twice, instead compute > them > once. Noted.
