summaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-21 21:25:05 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-21 21:25:05 +0000
commit2b3e9580536dfb5666b9d91e99baebf6d45bfa5f (patch)
treee7fda8237bde8672db2d797f4327493186bc57c0 /lib/Transforms/InstCombine/InstructionCombining.cpp
parent54c5bc87992ebeaa9e71f2bfb60ac5cf74b77db3 (diff)
downloadexternal_llvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.zip
external_llvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.tar.gz
external_llvm-2b3e9580536dfb5666b9d91e99baebf6d45bfa5f.tar.bz2
Add support for invoke to the MemoryBuiltin analysid.
Update comments accordingly. Make instcombine remove useless invokes to C++'s 'new' allocation function (test attached). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 2653fc3..269ea15 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1167,6 +1167,10 @@ Instruction *InstCombiner::visitMalloc(Instruction &MI) {
}
EraseInstFromFunction(*I);
}
+
+ if (InvokeInst *II = dyn_cast<InvokeInst>(&MI)) {
+ BranchInst::Create(II->getNormalDest(), II->getParent());
+ }
return EraseInstFromFunction(MI);
}
return 0;