diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 22:31:24 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 22:31:24 +0000 |
commit | c363c74c45756004f50c2bd67711400fd9026588 (patch) | |
tree | 7face75b3cff301e06b4016ad30309517d851d8f /lib | |
parent | 85b408991aff28ffa4e9e113a5a8a35b0db505c2 (diff) | |
download | external_llvm-c363c74c45756004f50c2bd67711400fd9026588.zip external_llvm-c363c74c45756004f50c2bd67711400fd9026588.tar.gz external_llvm-c363c74c45756004f50c2bd67711400fd9026588.tar.bz2 |
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')
-rw-r--r-- | lib/Transforms/InstCombine/InstructionCombining.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 07793ac..c5124bf 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); } |