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 | 9ac4661afa65ac809c9cd562a25ee8cfb362cb83 (patch) | |
| tree | e6d8923456f9348336b175c7bd3fe1bc03609dff /llvm | |
| parent | ec9653b363672487aaca905139d755cb837f36a3 (diff) | |
| download | bcm5719-llvm-9ac4661afa65ac809c9cd562a25ee8cfb362cb83.tar.gz bcm5719-llvm-9ac4661afa65ac809c9cd562a25ee8cfb362cb83.zip  | |
make instcombine produce calls to llvm.donothing instead of a random intrinsic
llvm-svn: 159384
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 11 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/objsize-64.ll | 2 | 
2 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 07793ac6b5f..c5124bf7b28 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/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);    } diff --git a/llvm/test/Transforms/InstCombine/objsize-64.ll b/llvm/test/Transforms/InstCombine/objsize-64.ll index 7a39f461948..4993063d1cc 100644 --- a/llvm/test/Transforms/InstCombine/objsize-64.ll +++ b/llvm/test/Transforms/InstCombine/objsize-64.ll @@ -19,7 +19,7 @@ define i64 @f1() {  ; CHECK: @f2  define i64 @f2() nounwind uwtable ssp {  entry: -; CHECK: invoke i8 @llvm.expect.i8(i8 0, i8 0) +; CHECK: invoke void @llvm.donothing()    %call = invoke noalias i8* @_Znwm(i64 13)            to label %invoke.cont unwind label %lpad  | 

