Skip to content

Commit

Permalink
It's not safe to blindly remove invoke instructions. This happens whe…
Browse files Browse the repository at this point in the history
…n 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
  • Loading branch information
nlewycky committed Jul 25, 2012
1 parent 2418275 commit b8cd66b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b8cd66b

Please sign in to comment.