mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-08 03:26:34 +00:00
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
This commit is contained in:
parent
85b408991a
commit
c363c74c45
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user