Skip to content

Commit a6f38b4

Browse files
author
Serguei Katkov
committed
[Statepoint] Remove redundant clear of call target on register
Patchable statepoint is lowered into sequence of nops, so zeroed call target should not be on register. It is better to use getTargetConstant instead of getConstant to select zero constant for call target. Reviewers: reames Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D74465
1 parent 5db0b25 commit a6f38b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,8 @@ SelectionDAGBuilder::LowerStatepoint(ImmutableStatepoint ISP,
859859
const auto &DL = DAG.getDataLayout();
860860

861861
unsigned AS = ISP.getCalledValue()->getType()->getPointerAddressSpace();
862-
ActualCallee = DAG.getConstant(0, getCurSDLoc(), TLI.getPointerTy(DL, AS));
862+
ActualCallee =
863+
DAG.getTargetConstant(0, getCurSDLoc(), TLI.getPointerTy(DL, AS));
863864
} else {
864865
ActualCallee = getValue(ISP.getCalledValue());
865866
}

llvm/test/CodeGen/X86/statepoint-call-lowering.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ define i1 @test_i1_return_patchable() gc "statepoint-example" {
141141
; CHECK: # %bb.0: # %entry
142142
; CHECK-NEXT: pushq %rax
143143
; CHECK-NEXT: .cfi_def_cfa_offset 16
144-
; CHECK-NEXT: xorl %eax, %eax
145144
; CHECK-NEXT: nopl (%rax)
146145
; CHECK-NEXT: .Ltmp7:
147146
; CHECK-NEXT: popq %rcx

0 commit comments

Comments
 (0)