summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2013-11-08 23:28:16 +0000
committerJuergen Ributzka <juergen@apple.com>2013-11-08 23:28:16 +0000
commit623d2e618f4e672c47edff9ec63ed6d733ac81d3 (patch)
treeb979de9c381f0ca66085b02e248b2fe3b9c50966 /include
parentd900b1179535298510490030a5d2ecce93f79eb0 (diff)
downloadllvm-623d2e618f4e672c47edff9ec63ed6d733ac81d3.tar.gz
llvm-623d2e618f4e672c47edff9ec63ed6d733ac81d3.tar.bz2
llvm-623d2e618f4e672c47edff9ec63ed6d733ac81d3.tar.xz
[Stackmap] Add AnyReg calling convention support for patchpoint intrinsic.
The idea of the AnyReg Calling Convention is to provide the call arguments in registers, but not to force them to be placed in a paticular order into a specified set of registers. Instead it is up tp the register allocator to assign any register as it sees fit. The same applies to the return value (if applicable). Differential Revision: http://llvm-reviews.chandlerc.com/D2009 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/StackMaps.h6
-rw-r--r--include/llvm/IR/CallingConv.h4
-rw-r--r--include/llvm/Target/Target.td4
3 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/StackMaps.h b/include/llvm/CodeGen/StackMaps.h
index 40eeb2e6d0..c79c3428b6 100644
--- a/include/llvm/CodeGen/StackMaps.h
+++ b/include/llvm/CodeGen/StackMaps.h
@@ -50,10 +50,12 @@ public:
/// This should be called by the MC lowering code _immediately_ before
/// lowering the MI to an MCInst. It records where the operands for the
/// instruction are stored, and outputs a label to record the offset of
- /// the call from the start of the text section.
+ /// the call from the start of the text section. In special cases (e.g. AnyReg
+ /// calling convention) the return register is also recorded if requested.
void recordStackMap(const MachineInstr &MI, uint32_t ID,
MachineInstr::const_mop_iterator MOI,
- MachineInstr::const_mop_iterator MOE);
+ MachineInstr::const_mop_iterator MOE,
+ bool recordResult = false);
/// If there is any stack map data, create a stack map section and serialize
/// the map info into it. This clears the stack map data structures
diff --git a/include/llvm/IR/CallingConv.h b/include/llvm/IR/CallingConv.h
index 35c7df9b2a..4437af2557 100644
--- a/include/llvm/IR/CallingConv.h
+++ b/include/llvm/IR/CallingConv.h
@@ -54,6 +54,10 @@ namespace CallingConv {
// WebKit JS - Calling convention for stack based JavaScript calls
WebKit_JS = 12,
+ // AnyReg - Calling convention for dynamic register based calls (e.g.
+ // stackmap and patchpoint intrinsics).
+ AnyReg = 13,
+
// Target - This is the start of the target-specific calling conventions,
// e.g. fastcall and thiscall on X86.
FirstTargetCC = 64,
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td
index 0c0b1edfe9..3f6eae6bb2 100644
--- a/include/llvm/Target/Target.td
+++ b/include/llvm/Target/Target.td
@@ -807,9 +807,9 @@ def STACKMAP : Instruction {
let mayLoad = 1;
}
def PATCHPOINT : Instruction {
- let OutOperandList = (outs);
+ let OutOperandList = (outs unknown:$dst);
let InOperandList = (ins i32imm:$id, i32imm:$nbytes, unknown:$callee,
- i32imm:$nargs, variable_ops);
+ i32imm:$nargs, i32imm:$cc, variable_ops);
let isCall = 1;
let mayLoad = 1;
}