Add an assertion for a condition that's always true, and not
authorDan Gohman <gohman@apple.com>
Wed, 4 Mar 2009 20:49:01 +0000 (20:49 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 4 Mar 2009 20:49:01 +0000 (20:49 +0000)
immediately obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66062 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 641f9b0e5c168fb41e7fd78aac4c817abfa20504..57f59570171f9edabe74420185cce7541b7a62d0 100644 (file)
@@ -2376,6 +2376,9 @@ ICmpInst *LoopStrengthReduce::OptimizeSMax(Loop *L, ICmpInst *Cond,
       AR->getStepRecurrence(*SE) != One)
     return Cond;
 
+  assert(AR->getLoop() == L &&
+         "Loop condition operand is an addrec in a different loop!");
+
   // Check the right operand of the select, and remember it, as it will
   // be used in the new comparison instruction.
   Value *NewRHS = 0;