diff options
author | Juergen Ributzka <juergen@apple.com> | 2013-11-09 01:51:33 +0000 |
---|---|---|
committer | Juergen Ributzka <juergen@apple.com> | 2013-11-09 01:51:33 +0000 |
commit | 87ed906b2edf33554e74f8182c26109e4e681b63 (patch) | |
tree | b8d06709e89c97cd111468677216f89f8bbc5174 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 00a15d94285b261bdd4e4727d52d76d4aee7b05d (diff) | |
download | bcm5719-llvm-87ed906b2edf33554e74f8182c26109e4e681b63.tar.gz bcm5719-llvm-87ed906b2edf33554e74f8182c26109e4e681b63.zip |
[Stackmap] Materialize the jump address within the patchpoint noop slide.
This patch moves the jump address materialization inside the noop slide. This
enables patching of the materialization itself or its complete removal. This
patch also adds the ability to define scratch registers that can be used safely
by the code called from the patchpoint intrinsic. At least one scratch register
is required, because that one is used for the materialization of the jump
address. This patch depends on D2009.
Differential Revision: http://llvm-reviews.chandlerc.com/D2074
Reviewed by Andy
llvm-svn: 194306
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 913f517d85e..98e067ebd49 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -6832,7 +6832,7 @@ void SelectionDAGBuilder::visitPatchpoint(const CallInst &CI) { // [Args...], // [live variables...]) - unsigned CC = CI.getCallingConv(); + CallingConv::ID CC = CI.getCallingConv(); bool isAnyRegCC = CC == CallingConv::AnyReg; bool hasDef = !CI.getType()->isVoidTy(); SDValue Callee = getValue(CI.getOperand(2)); // <target> @@ -6876,7 +6876,8 @@ void SelectionDAGBuilder::visitPatchpoint(const CallInst &CI) { } // Assume that the Callee is a constant address. Ops.push_back( - DAG.getIntPtrConstant(cast<ConstantSDNode>(Callee)->getZExtValue())); + DAG.getIntPtrConstant(cast<ConstantSDNode>(Callee)->getZExtValue(), + /*isTarget=*/true)); // Adjust <numArgs> to account for any arguments that have been passed on the // stack instead. @@ -6886,7 +6887,7 @@ void SelectionDAGBuilder::visitPatchpoint(const CallInst &CI) { Ops.push_back(DAG.getTargetConstant(NumCallRegArgs, MVT::i32)); // Add the calling convention - Ops.push_back(DAG.getTargetConstant(CC, MVT::i32)); + Ops.push_back(DAG.getTargetConstant((unsigned)CC, MVT::i32)); // Add the arguments we omitted previously. The register allocator should // place these in any free register. |