diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-07-25 21:19:40 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-07-25 21:19:40 +0000 |
commit | b8cd66b5d78eaeba41ab372aaca5180dd54e4385 (patch) | |
tree | 37273b9b8fd722bc72a292d30a401ea8d260b906 /lib/Transforms | |
parent | 24182757bfa5e36ddcc5e3c9d259367ee85ada65 (diff) | |
download | external_llvm-b8cd66b5d78eaeba41ab372aaca5180dd54e4385.zip external_llvm-b8cd66b5d78eaeba41ab372aaca5180dd54e4385.tar.gz external_llvm-b8cd66b5d78eaeba41ab372aaca5180dd54e4385.tar.bz2 |
It's not safe to blindly remove invoke instructions. This happens when we
encounter an invoke of an allocation function. This should fix the dragonegg
bootstrap. Testcase to follow, later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/GlobalOpt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 72623a3..6d950d2 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -352,7 +352,8 @@ static bool IsSafeComputationToRemove(Value *V) { return true; if (!V->hasOneUse()) return false; - if (isa<LoadInst>(V) || isa<Argument>(V) || isa<GlobalValue>(V)) + if (isa<LoadInst>(V) || isa<InvokeInst>(V) || isa<Argument>(V) || + isa<GlobalValue>(V)) return false; if (isAllocationFn(V)) return true; |