[llvm] [indvars] Update SCEV after eliminating CmpInst of loop latch (PR #207044)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 01:11:32 PDT 2026


================
@@ -266,6 +266,9 @@ void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp,
   const SCEV *S = SE->getSCEVAtScope(ICmp->getOperand(IVOperIdx), ICmpLoop);
   const SCEV *X = SE->getSCEVAtScope(ICmp->getOperand(1 - IVOperIdx), ICmpLoop);
 
+  bool IsExitCond = false;
+  if (ICmp == L->getLatchCmpInst())
----------------
nikic wrote:

Why does this only apply to latch exits? Shouldn't do we do this for any exit?

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


More information about the llvm-commits mailing list