aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-04 20:49:01 +0000
committerDan Gohman <gohman@apple.com>2009-03-04 20:49:01 +0000
commitbc10b8c6c7e85e44d8231dfb2fb41a60300857e3 (patch)
treeb24c2a13933247670e052298ae0984347cd88215
parentc23b8719ef9d6b1220e854b37d40e9e1c48a82bc (diff)
Add an assertion for a condition that's always true, and not
immediately obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66062 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 641f9b0e5c..57f5957017 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -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;