forked from OSchip/llvm-project
When testing whether one loop contains another, test this directly
rather than testing whether the loop contains the other's header. llvm-svn: 111039
This commit is contained in:
parent
3324b9ec67
commit
63c020a210
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue