[llvm] [IndVarSimplify] Don't perform LFTR only to convert the predicate (PR #126086)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 13:22:46 PST 2025


artagnon wrote:

Based on my investigation, I concur with what you have said. I couldn't quite figure out the purpose of the LFTR, as it always seemed to be making code worse or doing redundant work that would be better left to the dedicated LSR: LoopTermFold is new and was recently split off from LSR. I was just looking at 7da2417c (indvars: LinearFunctionTestReplace for non-canonical IVs) from fourteen years ago, but I'm not sure what the original justification was: maybe LLVM was somehow better with eq/ne conditions back then, and LSR hadn't matured?

That said, I'm happy to proceed with the gradual removal of the LFTR. My concern is that IVSimplify is a very core transform, and any change to it has to be checked thoroughly, and I fear that we wouldn't be able to audit the crazy-large diffs when running each change against a large corpus.

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


More information about the llvm-commits mailing list