diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -859,7 +859,8 @@ const auto &DL = DAG.getDataLayout(); unsigned AS = ISP.getCalledValue()->getType()->getPointerAddressSpace(); - ActualCallee = DAG.getConstant(0, getCurSDLoc(), TLI.getPointerTy(DL, AS)); + ActualCallee = + DAG.getTargetConstant(0, getCurSDLoc(), TLI.getPointerTy(DL, AS)); } else { ActualCallee = getValue(ISP.getCalledValue()); } diff --git a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll --- a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll +++ b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll @@ -141,7 +141,6 @@ ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: pushq %rax ; CHECK-NEXT: .cfi_def_cfa_offset 16 -; CHECK-NEXT: xorl %eax, %eax ; CHECK-NEXT: nopl (%rax) ; CHECK-NEXT: .Ltmp7: ; CHECK-NEXT: popq %rcx