summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackMaps.cpp
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
commit9969d3e6e86236878fd4b4fab55473870290d709 (patch)
tree66fe199a0727596763ebf312f89eb7aacb9d75a6 /llvm/lib/CodeGen/StackMaps.cpp
parent1b302289945dbffe4cc94c22edb65efac8e1e1b0 (diff)
downloadbcm5719-llvm-9969d3e6e86236878fd4b4fab55473870290d709.tar.gz
bcm5719-llvm-9969d3e6e86236878fd4b4fab55473870290d709.zip
[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 llvm-svn: 194293
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r--llvm/lib/CodeGen/StackMaps.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp
index 51580b479d8..89da78294fc 100644
--- a/llvm/lib/CodeGen/StackMaps.cpp
+++ b/llvm/lib/CodeGen/StackMaps.cpp
@@ -30,7 +30,8 @@ using namespace llvm;
void StackMaps::recordStackMap(const MachineInstr &MI, uint32_t ID,
MachineInstr::const_mop_iterator MOI,
- MachineInstr::const_mop_iterator MOE) {
+ MachineInstr::const_mop_iterator MOE,
+ bool recordResult) {
MCContext &OutContext = AP.OutStreamer.getContext();
MCSymbol *MILabel = OutContext.CreateTempSymbol();
@@ -38,6 +39,16 @@ void StackMaps::recordStackMap(const MachineInstr &MI, uint32_t ID,
LocationVec CallsiteLocs;
+ if (recordResult) {
+ std::pair<Location, MachineInstr::const_mop_iterator> ParseResult =
+ OpParser(MI.operands_begin(), llvm::next(MI.operands_begin(), 1));
+
+ Location &Loc = ParseResult.first;
+ assert(Loc.LocType == Location::Register &&
+ "Stackmap return location must be a register.");
+ CallsiteLocs.push_back(Loc);
+ }
+
while (MOI != MOE) {
std::pair<Location, MachineInstr::const_mop_iterator> ParseResult =
OpParser(MOI, MOE);
OpenPOWER on IntegriCloud