Partially revert 279331, as we modify this instruction in the loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin 2016-08-19 22:18:38 +00:00
parent b2ae2edf5a
commit 9e4dd1259b

View File

@ -1150,9 +1150,13 @@ bool SeparateConstOffsetFromGEP::reuniteExts(Instruction *I) {
bool SeparateConstOffsetFromGEP::reuniteExts(Function &F) {
bool Changed = false;
DominatingExprs.clear();
for (const auto Node : depth_first(DT))
for (auto &I : *(Node->getBlock()))
Changed |= reuniteExts(&I);
for (const auto Node : depth_first(DT)) {
BasicBlock *BB = Node->getBlock();
for (auto I = BB->begin(); I != BB->end(); ) {
Instruction *Cur = &*I++;
Changed |= reuniteExts(Cur);
}
}
return Changed;
}