From: Dan Gohman Date: Wed, 4 Mar 2009 20:49:01 +0000 (+0000) Subject: Add an assertion for a condition that's always true, and not X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bc10b8c6c7e85e44d8231dfb2fb41a60300857e3;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 641f9b0e5c1..57f59570171 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;