summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
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
commit952f5d562c40bc19147df4fbf3415069659236d1 (patch)
treea0ccf963deb77dcd79c2494a6e7ad9648a121f7b /lib/Transforms/IPO
parent9669f749764997ab7033d5c4b0546fe739dd71d8 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 60ce958de0d..72623a36e50 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/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();
}
}