summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2016-08-19 22:18:38 +0000
committerDaniel Berlin <dberlin@dberlin.org>2016-08-19 22:18:38 +0000
commit11da66fc103687beeb785eee224ede91669d9013 (patch)
treeac6f6dcd08bf949c1d746d4638b3d43758063287 /llvm/lib/Transforms
parent5968c3ac1f7828ffa98ca03dc0eaf1bfd08fd13e (diff)
downloadbcm5719-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/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp10
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;
}
OpenPOWER on IntegriCloud