summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-13 20:23:25 +0000
committerDan Gohman <gohman@apple.com>2010-08-13 20:23:25 +0000
commit63c020a21014eb02b3fe0e3ab04e5197c440787d (patch)
tree4a5d4c23ad3fdfe004e13610300811f9539f0cc0 /llvm/lib/Analysis/ScalarEvolution.cpp
parent3324b9ec67d3fd4e699954fda79eadb9940a51d0 (diff)
downloadbcm5719-llvm-63c020a21014eb02b3fe0e3ab04e5197c440787d.tar.gz
bcm5719-llvm-63c020a21014eb02b3fe0e3ab04e5197c440787d.zip
When testing whether one loop contains another, test this directly
rather than testing whether the loop contains the other's header. llvm-svn: 111039
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 6bb121f82ab..2cf8fff32b0 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2047,9 +2047,9 @@ ScalarEvolution::getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands,
// Canonicalize nested AddRecs in by nesting them in order of loop depth.
if (const SCEVAddRecExpr *NestedAR = dyn_cast<SCEVAddRecExpr>(Operands[0])) {
const Loop *NestedLoop = NestedAR->getLoop();
- if (L->contains(NestedLoop->getHeader()) ?
+ if (L->contains(NestedLoop) ?
(L->getLoopDepth() < NestedLoop->getLoopDepth()) :
- (!NestedLoop->contains(L->getHeader()) &&
+ (!NestedLoop->contains(L) &&
DT->dominates(L->getHeader(), NestedLoop->getHeader()))) {
SmallVector<const SCEV *, 4> NestedOperands(NestedAR->op_begin(),
NestedAR->op_end());
OpenPOWER on IntegriCloud