1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

SCEVExpander: hoistStep should check strict dominance.

llvm-svn: 147683
This commit is contained in:
Andrew Trick 2012-01-06 21:23:43 +00:00
parent 3da57dd6b3
commit a2096be363

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);