summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-07-25 21:19:40 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-07-25 21:19:40 +0000
commit7d0f110cb3e388316098402a158cdd9423a2a73a (patch)
tree41a1b1839ea9aedd51ddb79dd0abfaa2a9ddf7a2 /llvm/lib/Transforms/IPO/GlobalOpt.cpp
parent279ceecf65d26b3b07454aaf6ced4ebc402e03ec (diff)
downloadbcm5719-llvm-7d0f110cb3e388316098402a158cdd9423a2a73a.tar.gz
bcm5719-llvm-7d0f110cb3e388316098402a158cdd9423a2a73a.zip
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. llvm-svn: 160757
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 72623a36e50..6d950d20240 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud