diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-13 20:23:25 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-13 20:23:25 +0000 |
commit | 9cba97886c9b6088ac35ecc6c3122e2c7665d6da (patch) | |
tree | 53ab64bff4ab3ea01e96c776788fc380ca80950a /lib/Analysis/ScalarEvolution.cpp | |
parent | 9f1fb42b7e6260bcc535cfd50df60b35e17672f8 (diff) |
When testing whether one loop contains another, test this directly
rather than testing whether the loop contains the other's header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 6bb121f82a..2cf8fff32b 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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()); |