SCEVExpander: hoistStep should check strict dominance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147683 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2012-01-06 21:23:43 +00:00
parent b937b76045
commit 3326ec1842

View File

@ -1564,7 +1564,7 @@ bool SCEVExpander::hoistStep(Instruction *IncV, Instruction *InsertPos,
for (User::op_iterator OI = IncV->op_begin(), OE = IncV->op_end();
OI != OE; ++OI) {
Instruction *OInst = dyn_cast<Instruction>(OI);
if (OInst && !DT->dominates(OInst, InsertPos))
if (OInst && (OInst == InsertPos || !DT->dominates(OInst, InsertPos)))
return false;
}
IncV->moveBefore(InsertPos);