[llvm] [LSR] All known LCSSA fixes (PR #193824)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 07:05:19 PDT 2026


cdevadas wrote:

> > does it make sense to have a fix right now that at least keeps behavior similar to legacy (either make LSR a function pass now until its ready to preserve LCSSA without regressions or make LCSSA optional as @nikic earlier suggsested) ? especially considering we see quite a few regressions right now and this being a major blocker towards enabling NPM ? (this right now stands to be the only blocker for AMDGPU backend at least)
> 
> I think we need to figure out what we want to do first (whether or not we want to preserve LCSSA in LSR). It's been a blocker for a while, so another week or two can't hurt. I'll hopefully spend some time on this soon.

While @boomanaiden154 continues the investigation, I want to reflect my thoughts here. I appreciate the continued effort to consolidate the LCSSA fixes in the LSR pass.
However, I have a broader concern about the timeline. NPM enablement for backend passes has been blocked for an extended period, and this LSR LCSSA issue has become the primary blocker. The recent codegen benchmark results showed significant regressions with this PR, and the effort required to investigate and provide regression-free solutions remains unclear.
I fully appreciate the value of the stricter infrastructure requirements that NPM introduces: LCSSA preservation checks and MIR verification before ISA emission are good engineering practices that improve robustness compared to the legacy pass manager. However, when such requirements present ongoing challenges to implement without regressions and no clear resolution timeline, what is the appropriate path forward? Should we continue blocking NPM adoption indefinitely, or should we adopt an interim solution that unblocks progress while long-term work continues in parallel?
I believe we should adopt a short-term fix by making LCSSA optional, as suggested by @nikic in [PR #185373](https://github.com/llvm/llvm-project/pull/185373#issuecomment-2055891234). We have done the same for MemorySSA, and it is fair to extend this approach to LCSSA as well. If this is not acceptable, the alternative approach to convert LSR into a function pass ([PR #186312](https://github.com/llvm/llvm-project/pull/186312) by @vikramRH) could serve as a potential short-term solution.
The reason I vouch for an interim approach is to remove time pressure from the LCSSA preservation work, allowing thorough investigation of regressions. Once the investigation is complete and fixes are implemented with acceptable performance, we can revert the interim solution and adopt proper LCSSA preservation. This would unblock years of NPM porting effort by various targets rather than continuing an indefinite blocking situation with no clear resolution timeline. 

https://github.com/llvm/llvm-project/pull/193824


More information about the llvm-commits mailing list