summaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-06-28 22:31:24 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-06-28 22:31:24 +0000
commitc363c74c45756004f50c2bd67711400fd9026588 (patch)
tree7face75b3cff301e06b4016ad30309517d851d8f /lib/Transforms/InstCombine
parent85b408991aff28ffa4e9e113a5a8a35b0db505c2 (diff)
make instcombine produce calls to llvm.donothing instead of a random intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 07793ac6b5f..c5124bf7b28 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1169,14 +1169,11 @@ Instruction *InstCombiner::visitMalloc(Instruction &MI) {
}
if (InvokeInst *II = dyn_cast<InvokeInst>(&MI)) {
- // Replace invoke with a NOOP intrinsic to maintain the original CFG
+ // Replace invoke with a NOP intrinsic to maintain the original CFG
Module *M = II->getParent()->getParent()->getParent();
- IntegerType *Ty = IntegerType::get(II->getContext(), 8);
- ConstantInt *CI = ConstantInt::get(Ty, 0);
- Value *Args[] = {CI, CI};
- Function *F = Intrinsic::getDeclaration(M, Intrinsic::expect, Ty);
- InvokeInst::Create(F, II->getNormalDest(), II->getUnwindDest(), Args,
- "dummy", II->getParent());
+ Function *F = Intrinsic::getDeclaration(M, Intrinsic::donothing);
+ InvokeInst::Create(F, II->getNormalDest(), II->getUnwindDest(),
+ ArrayRef<Value *>(), "", II->getParent());
}
return EraseInstFromFunction(MI);
}