https://github.com/nikic commented: But in any case, this needs to be split into two changes. The changes to the isLoopCounter() definition should be a separate PR from the IV elimination. https://github.com/llvm/llvm-project/pull/146845