From 8ca0885d69ed4c41f9df940f7da72b3adc8193e3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sun, 24 May 2009 23:25:42 +0000 Subject: Change ScalarEvolution::getSCEVAtScope to always return the original value in the case where a loop exit value cannot be computed, instead of only in some cases while using SCEVCouldNotCompute in others. This simplifies getSCEVAtScope's callers. llvm-svn: 72375 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 7300bf47fe7..ca7aa7bd30d 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -275,10 +275,8 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, // Okay, this instruction has a user outside of the current loop // and varies predictably *inside* the loop. Evaluate the value it // contains when the loop exits, if possible. - SCEVHandle SH = SE->getSCEV(Inst); - SCEVHandle ExitValue = SE->getSCEVAtScope(SH, L->getParentLoop()); - if (isa(ExitValue) || - !ExitValue->isLoopInvariant(L)) + SCEVHandle ExitValue = SE->getSCEVAtScope(Inst, L->getParentLoop()); + if (!ExitValue->isLoopInvariant(L)) continue; Changed = true; -- cgit v1.2.3