From bc10b8c6c7e85e44d8231dfb2fb41a60300857e3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 4 Mar 2009 20:49:01 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.11.0