From 2b3e9580536dfb5666b9d91e99baebf6d45bfa5f Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 21 Jun 2012 21:25:05 +0000 Subject: 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 --- lib/Transforms/InstCombine/InstructionCombining.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp') diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 2653fc316d..269ea1516f 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(&MI)) { + BranchInst::Create(II->getNormalDest(), II->getParent()); + } return EraseInstFromFunction(MI); } return 0; -- cgit v1.2.3-70-g09d2