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 | 974681b269e866e9a0d13b7a03375c73b79151af (patch) | |
| tree | 53ab64bff4ab3ea01e96c776788fc380ca80950a /lib/Analysis/ScalarEvolution.cpp | |
| parent | 0ada25cdd5470cbcaea00bf55ccf36ee84a9433d (diff) | |
| download | external_llvm-974681b269e866e9a0d13b7a03375c73b79151af.zip external_llvm-974681b269e866e9a0d13b7a03375c73b79151af.tar.gz external_llvm-974681b269e866e9a0d13b7a03375c73b79151af.tar.bz2 | |
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 6bb121f..2cf8fff 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()); |
