[llvm] [SCEV] Try to re-use existing LCSSA phis when expanding SCEVAddRecExpr. (PR #147214)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 13:46:03 PDT 2025


fhahn wrote:

I also put up https://github.com/llvm/llvm-project/pull/147824 with a more general version that helps in more cases for runtime checks generated by LV (checking the difference of pointer AddRecs). The additional commit is https://github.com/llvm/llvm-project/pull/147824/commits/7386b29b9818dc2bee5e4eb3da952fc49bf8e931

I noticed this missed optimizations when looking into some regressions with https://github.com/llvm/llvm-project/pull/142309, which turns some phis into single-entry ones, which SCEV will look through now (and expand the whole AddRec), whereas before it would have to treat the LCSSA phi as SCEVUnknown.

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


More information about the llvm-commits mailing list