[llvm-commits] [llvm] r159384 - in /llvm/trunk: lib/Transforms/InstCombine/InstructionCombining.cpp test/Transforms/InstCombine/objsize-64.ll
Nuno Lopes
nunoplopes at sapo.pt
Thu Jun 28 15:31:24 PDT 2012
Author: nlopes
Date: Thu Jun 28 17:31:24 2012
New Revision: 159384
URL: http://llvm.org/viewvc/llvm-project?rev=159384&view=rev
Log:
make instcombine produce calls to llvm.donothing instead of a random intrinsic
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/trunk/test/Transforms/InstCombine/objsize-64.ll
Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=159384&r1=159383&r2=159384&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Thu Jun 28 17:31:24 2012
@@ -1169,14 +1169,11 @@
}
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);
}
Modified: llvm/trunk/test/Transforms/InstCombine/objsize-64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/objsize-64.ll?rev=159384&r1=159383&r2=159384&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/objsize-64.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/objsize-64.ll Thu Jun 28 17:31:24 2012
@@ -19,7 +19,7 @@
; 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
More information about the llvm-commits
mailing list