diff options
| author | Daniel Berlin <dberlin@dberlin.org> | 2016-08-19 22:18:38 +0000 |
|---|---|---|
| committer | Daniel Berlin <dberlin@dberlin.org> | 2016-08-19 22:18:38 +0000 |
| commit | 11da66fc103687beeb785eee224ede91669d9013 (patch) | |
| tree | ac6f6dcd08bf949c1d746d4638b3d43758063287 /llvm/lib | |
| parent | 5968c3ac1f7828ffa98ca03dc0eaf1bfd08fd13e (diff) | |
| download | bcm5719-llvm-11da66fc103687beeb785eee224ede91669d9013.tar.gz bcm5719-llvm-11da66fc103687beeb785eee224ede91669d9013.zip | |
Partially revert 279331, as we modify this instruction in the loop
llvm-svn: 279335
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp index 961a3c1c19c..62c9f46089a 100644 --- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp +++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp @@ -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; } |

