summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-07-24 21:33:00 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-07-24 21:33:00 +0000
commit38be931223fc6fbd1ab327a5827874f0c0694f85 (patch)
tree3c9d87705272e2b715ed080a8cd5cf429f0bdc77 /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parent041c0d4c210103a9b90b4c2a163702cb387acd74 (diff)
downloadbcm5719-llvm-38be931223fc6fbd1ab327a5827874f0c0694f85.tar.gz
bcm5719-llvm-38be931223fc6fbd1ab327a5827874f0c0694f85.zip
Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit the testcase this evening. llvm-svn: 160693
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 60ce958de0d..72623a36e50 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -442,12 +442,14 @@ static bool CleanupPointerRootUsers(GlobalVariable *GV) {
Dead[i].second->eraseFromParent();
Instruction *I = Dead[i].first;
do {
+ if (isAllocationFn(I))
+ break;
Instruction *J = dyn_cast<Instruction>(I->getOperand(0));
if (!J)
break;
I->eraseFromParent();
I = J;
- } while (!isAllocationFn(I));
+ } while (1);
I->eraseFromParent();
}
}
OpenPOWER on IntegriCloud