[Statepoints] Let patchable statepoints have a symbolic call target.

Summary:
As added initially, statepoints required their call targets to be a
constant pointer null if ``numPatchBytes`` was non-zero.  This turns out
to be a problem ergonomically, since there is no way to mark patchable
statepoints as calling a (readable) symbolic value.

This change remove the restriction of requiring ``null`` call targets
for patchable statepoints, and changes PlaceSafepoints to maintain the
symbolic call target through its transformation.

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243502 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das
2015-07-28 23:50:30 +00:00
parent a27dfaf544
commit 44d65eac43
6 changed files with 25 additions and 32 deletions

View File

@@ -289,7 +289,23 @@ lowerCallFromStatepoint(ImmutableStatepoint ISP, MachineBasicBlock *LandingPad,
ImmutableCallSite CS(ISP.getCallSite());
SDValue ActualCallee = Builder.getValue(ISP.getCalledValue());
SDValue ActualCallee;
if (ISP.getNumPatchBytes() > 0) {
// If we've been asked to emit a nop sequence instead of a call instruction
// for this statepoint then don't lower the call target, but use a constant
// `null` instead. Not lowering the call target lets statepoint clients get
// away without providing a physical address for the symbolic call target at
// link time.
const auto &TLI = Builder.DAG.getTargetLoweringInfo();
const auto &DL = Builder.DAG.getDataLayout();
unsigned AS = ISP.getCalledValue()->getType()->getPointerAddressSpace();
ActualCallee = Builder.DAG.getConstant(0, Builder.getCurSDLoc(),
TLI.getPointerTy(DL, AS));
} else
ActualCallee = Builder.getValue(ISP.getCalledValue());
assert(CS.getCallingConv() != CallingConv::AnyReg &&
"anyregcc is not supported on statepoints!");