diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-07-24 21:33:00 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-07-24 21:33:00 +0000 |
commit | 952f5d562c40bc19147df4fbf3415069659236d1 (patch) | |
tree | a0ccf963deb77dcd79c2494a6e7ad9648a121f7b /lib/Transforms | |
parent | 9669f749764997ab7033d5c4b0546fe739dd71d8 (diff) | |
download | external_llvm-952f5d562c40bc19147df4fbf3415069659236d1.zip external_llvm-952f5d562c40bc19147df4fbf3415069659236d1.tar.gz external_llvm-952f5d562c40bc19147df4fbf3415069659236d1.tar.bz2 |
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')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 60ce958..72623a3 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(); } } |