[Stackmaps] Update the stackmap format to use 64-bit relocations for the function address and properly align all entries.

This commit updates the stackmap format to version 1 to indicate the
reorganizaion of several fields. This was done in order to align stackmap
entries to their natural alignment and to minimize padding.

Fixes <rdar://problem/16005902>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205254 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Juergen Ributzka
2014-03-31 22:14:04 +00:00
parent 4ffbb65494
commit d8c9577764
8 changed files with 249 additions and 139 deletions

View File

@@ -313,17 +313,21 @@ format of this section follows:
.. code-block:: none .. code-block:: none
uint32 : Reserved (header) Header {
uint32 : NumFunctions uint8 : Stack Map Version (current version is 1)
StkSizeRecord[NumFunctions] { uint8 : Reserved (expected to be 0)
uint32 : Function Offset uint16 : Reserved (expected to be 0)
uint32 : Stack Size
} }
uint32 : NumFunctions
uint32 : NumConstants uint32 : NumConstants
uint32 : NumRecords
StkSizeRecord[NumFunctions] {
uint64 : Function Address
uint64 : Stack Size
}
Constants[NumConstants] { Constants[NumConstants] {
uint64 : LargeConstant uint64 : LargeConstant
} }
uint32 : NumRecords
StkMapRecord[NumRecords] { StkMapRecord[NumRecords] {
uint64 : PatchPoint ID uint64 : PatchPoint ID
uint32 : Instruction Offset uint32 : Instruction Offset
@@ -335,12 +339,14 @@ format of this section follows:
uint16 : Dwarf RegNum uint16 : Dwarf RegNum
int32 : Offset or SmallConstant int32 : Offset or SmallConstant
} }
uint16 : Padding
uint16 : NumLiveOuts uint16 : NumLiveOuts
LiveOuts[NumLiveOuts] LiveOuts[NumLiveOuts]
uint16 : Dwarf RegNum uint16 : Dwarf RegNum
uint8 : Reserved uint8 : Reserved
uint8 : Size in Bytes uint8 : Size in Bytes
} }
uint32 : Padding (only if required to align to 8 byte)
} }
The first byte of each location encodes a type that indicates how to The first byte of each location encodes a type that indicates how to

View File

@@ -133,7 +133,7 @@ public:
private: private:
typedef SmallVector<Location, 8> LocationVec; typedef SmallVector<Location, 8> LocationVec;
typedef SmallVector<LiveOutReg, 8> LiveOutVec; typedef SmallVector<LiveOutReg, 8> LiveOutVec;
typedef MapVector<const MCSymbol *, uint32_t> FnStackSizeMap; typedef MapVector<const MCSymbol *, uint64_t> FnStackSizeMap;
struct CallsiteInfo { struct CallsiteInfo {
const MCExpr *CSOffsetExpr; const MCExpr *CSOffsetExpr;

View File

@@ -225,7 +225,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
// Record the stack size of the current function. // Record the stack size of the current function.
const MachineFrameInfo *MFI = AP.MF->getFrameInfo(); const MachineFrameInfo *MFI = AP.MF->getFrameInfo();
FnStackSize[AP.CurrentFnSym] = FnStackSize[AP.CurrentFnSym] =
MFI->hasVarSizedObjects() ? ~0U : MFI->getStackSize(); MFI->hasVarSizedObjects() ? UINT64_MAX : MFI->getStackSize();
} }
void StackMaps::recordStackMap(const MachineInstr &MI) { void StackMaps::recordStackMap(const MachineInstr &MI) {
@@ -261,15 +261,19 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) {
/// serializeToStackMapSection conceptually populates the following fields: /// serializeToStackMapSection conceptually populates the following fields:
/// ///
/// uint32 : Reserved (header) /// Header {
/// uint32 : NumFunctions /// uint8 : Stack Map Version (currently 1)
/// StkSizeRecord[NumFunctions] { /// uint8 : Reserved (expected to be 0)
/// uint32 : Function Offset /// uint16 : Reserved (expected to be 0)
/// uint32 : Stack Size
/// } /// }
/// uint32 : NumFunctions
/// uint32 : NumConstants /// uint32 : NumConstants
/// int64 : Constants[NumConstants]
/// uint32 : NumRecords /// uint32 : NumRecords
/// StkSizeRecord[NumFunctions] {
/// uint64 : Function Address
/// uint64 : Stack Size
/// }
/// int64 : Constants[NumConstants]
/// StkMapRecord[NumRecords] { /// StkMapRecord[NumRecords] {
/// uint64 : PatchPoint ID /// uint64 : PatchPoint ID
/// uint32 : Instruction Offset /// uint32 : Instruction Offset
@@ -281,11 +285,14 @@ void StackMaps::recordPatchPoint(const MachineInstr &MI) {
/// uint16 : Dwarf RegNum /// uint16 : Dwarf RegNum
/// int32 : Offset /// int32 : Offset
/// } /// }
/// uint16 : Padding
/// uint16 : NumLiveOuts /// uint16 : NumLiveOuts
/// LiveOuts[NumLiveOuts] /// LiveOuts[NumLiveOuts] {
/// uint16 : Dwarf RegNum /// uint16 : Dwarf RegNum
/// uint8 : Reserved /// uint8 : Reserved
/// uint8 : Size in Bytes /// uint8 : Size in Bytes
/// }
/// uint32 : Padding (only if required to align to 8 byte)
/// } /// }
/// ///
/// Location Encoding, Type, Value: /// Location Encoding, Type, Value:
@@ -319,32 +326,35 @@ void StackMaps::serializeToStackMapSection() {
DEBUG(dbgs() << "********** Stack Map Output **********\n"); DEBUG(dbgs() << "********** Stack Map Output **********\n");
// Header. // Header.
AP.OutStreamer.EmitIntValue(0, 4); AP.OutStreamer.EmitIntValue(1, 1); // Version.
AP.OutStreamer.EmitIntValue(0, 1); // Reserved.
AP.OutStreamer.EmitIntValue(0, 2); // Reserved.
// Num functions. // Num functions.
DEBUG(dbgs() << WSMP << "#functions = " << FnStackSize.size() << '\n');
AP.OutStreamer.EmitIntValue(FnStackSize.size(), 4); AP.OutStreamer.EmitIntValue(FnStackSize.size(), 4);
// Num constants.
DEBUG(dbgs() << WSMP << "#constants = " << ConstPool.getNumConstants()
<< '\n');
AP.OutStreamer.EmitIntValue(ConstPool.getNumConstants(), 4);
// Num callsites.
DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << '\n');
AP.OutStreamer.EmitIntValue(CSInfos.size(), 4);
// Stack size entries. // Function stack size entries.
for (FnStackSizeMap::iterator I = FnStackSize.begin(), E = FnStackSize.end(); for (FnStackSizeMap::iterator I = FnStackSize.begin(), E = FnStackSize.end();
I != E; ++I) { I != E; ++I) {
AP.OutStreamer.EmitSymbolValue(I->first, 4); AP.OutStreamer.EmitSymbolValue(I->first, 8);
AP.OutStreamer.EmitIntValue(I->second, 4); AP.OutStreamer.EmitIntValue(I->second, 8);
} }
// Num constants.
AP.OutStreamer.EmitIntValue(ConstPool.getNumConstants(), 4);
// Constant pool entries. // Constant pool entries.
for (unsigned i = 0; i < ConstPool.getNumConstants(); ++i) for (unsigned i = 0; i < ConstPool.getNumConstants(); ++i)
AP.OutStreamer.EmitIntValue(ConstPool.getConstant(i), 8); AP.OutStreamer.EmitIntValue(ConstPool.getConstant(i), 8);
DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << "\n"); // Callsite entries.
AP.OutStreamer.EmitIntValue(CSInfos.size(), 4);
for (CallsiteInfoList::const_iterator CSII = CSInfos.begin(), for (CallsiteInfoList::const_iterator CSII = CSInfos.begin(),
CSIE = CSInfos.end(); CSIE = CSInfos.end(); CSII != CSIE; ++CSII) {
CSII != CSIE; ++CSII) {
uint64_t CallsiteID = CSII->ID; uint64_t CallsiteID = CSII->ID;
const LocationVec &CSLocs = CSII->Locations; const LocationVec &CSLocs = CSII->Locations;
const LiveOutVec &LiveOuts = CSII->LiveOuts; const LiveOutVec &LiveOuts = CSII->LiveOuts;
@@ -360,7 +370,9 @@ void StackMaps::serializeToStackMapSection() {
AP.OutStreamer.EmitValue(CSII->CSOffsetExpr, 4); AP.OutStreamer.EmitValue(CSII->CSOffsetExpr, 4);
AP.OutStreamer.EmitIntValue(0, 2); // Reserved. AP.OutStreamer.EmitIntValue(0, 2); // Reserved.
AP.OutStreamer.EmitIntValue(0, 2); // 0 locations. AP.OutStreamer.EmitIntValue(0, 2); // 0 locations.
AP.OutStreamer.EmitIntValue(0, 2); // padding.
AP.OutStreamer.EmitIntValue(0, 2); // 0 live-out registers. AP.OutStreamer.EmitIntValue(0, 2); // 0 live-out registers.
AP.OutStreamer.EmitIntValue(0, 4); // padding.
continue; continue;
} }
@@ -438,6 +450,8 @@ void StackMaps::serializeToStackMapSection() {
DEBUG(dbgs() << WSMP << " has " << LiveOuts.size() DEBUG(dbgs() << WSMP << " has " << LiveOuts.size()
<< " live-out registers\n"); << " live-out registers\n");
// Num live-out registers and padding to align to 4 byte.
AP.OutStreamer.EmitIntValue(0, 2);
AP.OutStreamer.EmitIntValue(LiveOuts.size(), 2); AP.OutStreamer.EmitIntValue(LiveOuts.size(), 2);
operIdx = 0; operIdx = 0;
@@ -452,6 +466,8 @@ void StackMaps::serializeToStackMapSection() {
AP.OutStreamer.EmitIntValue(0, 1); AP.OutStreamer.EmitIntValue(0, 1);
AP.OutStreamer.EmitIntValue(LI->Size, 1); AP.OutStreamer.EmitIntValue(LI->Size, 1);
} }
// Emit alignment to 8 byte.
AP.OutStreamer.EmitValueToAlignment(8);
} }
AP.OutStreamer.AddBlankLine(); AP.OutStreamer.AddBlankLine();

View File

@@ -4,29 +4,34 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps: ; CHECK-NEXT: __LLVM_StackMaps:
; Header ; Header
; CHECK-NEXT: .long 0 ; CHECK-NEXT: .byte 1
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .short 0
; Num Functions ; Num Functions
; CHECK-NEXT: .long 8 ; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _test ; Num LargeConstants
; CHECK-NEXT: .long 16 ; CHECK-NEXT: .long 0
; CHECK-NEXT: .long _property_access1
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _property_access2
; CHECK-NEXT: .long 32
; CHECK-NEXT: .long _property_access3
; CHECK-NEXT: .long 32
; CHECK-NEXT: .long _anyreg_test1
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _anyreg_test2
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _patchpoint_spilldef
; CHECK-NEXT: .long 112
; CHECK-NEXT: .long _patchpoint_spillargs
; CHECK-NEXT: .long 128
; Num Constants
; CHECK-NEXT: .long 0
; Num Callsites ; Num Callsites
; CHECK-NEXT: .long 8 ; CHECK-NEXT: .long 8
; Functions and stack size
; CHECK-NEXT: .quad _test
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _property_access1
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _property_access2
; CHECK-NEXT: .quad 32
; CHECK-NEXT: .quad _property_access3
; CHECK-NEXT: .quad 32
; CHECK-NEXT: .quad _anyreg_test1
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _anyreg_test2
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _patchpoint_spilldef
; CHECK-NEXT: .quad 112
; CHECK-NEXT: .quad _patchpoint_spillargs
; CHECK-NEXT: .quad 128
; test ; test
; CHECK-LABEL: .long L{{.*}}-_test ; CHECK-LABEL: .long L{{.*}}-_test

View File

@@ -8,37 +8,44 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps: ; CHECK-NEXT: __LLVM_StackMaps:
; CHECK-NEXT: .long 0 ; Header
; CHECK-NEXT: .byte 1
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .short 0
; Num Functions ; Num Functions
; CHECK-NEXT: .long 11 ; CHECK-NEXT: .long 11
; CHECK-NEXT: .long _constantargs
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _osrinline
; CHECK-NEXT: .long 32
; CHECK-NEXT: .long _osrcold
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _propertyRead
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _propertyWrite
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _jsVoidCall
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _jsIntCall
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _spilledValue
; CHECK-NEXT: .long 160
; CHECK-NEXT: .long _spilledStackMapValue
; CHECK-NEXT: .long 128
; CHECK-NEXT: .long _liveConstant
; CHECK-NEXT: .long 16
; CHECK-NEXT: .long _clobberLR
; CHECK-NEXT: .long 112
; Num LargeConstants ; Num LargeConstants
; CHECK-NEXT: .long 2 ; CHECK-NEXT: .long 2
; Num Callsites
; CHECK-NEXT: .long 11
; Functions and stack size
; CHECK-NEXT: .quad _constantargs
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _osrinline
; CHECK-NEXT: .quad 32
; CHECK-NEXT: .quad _osrcold
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _propertyRead
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _propertyWrite
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _jsVoidCall
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _jsIntCall
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _spilledValue
; CHECK-NEXT: .quad 160
; CHECK-NEXT: .quad _spilledStackMapValue
; CHECK-NEXT: .quad 128
; CHECK-NEXT: .quad _liveConstant
; CHECK-NEXT: .quad 16
; CHECK-NEXT: .quad _clobberLR
; CHECK-NEXT: .quad 112
; Num LargeConstants
; CHECK-NEXT: .quad 4294967295 ; CHECK-NEXT: .quad 4294967295
; CHECK-NEXT: .quad 4294967296 ; CHECK-NEXT: .quad 4294967296
; Num Callsites
; CHECK-NEXT: .long 11
; Constant arguments ; Constant arguments
; ;

View File

@@ -7,30 +7,37 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps: ; CHECK-NEXT: __LLVM_StackMaps:
; Header ; Header
; CHECK-NEXT: .long 0 ; CHECK-NEXT: .byte 1
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .short 0
; Num Functions ; Num Functions
; CHECK-NEXT: .long 8 ; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _test
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _property_access1
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _property_access2
; CHECK-NEXT: .long 24
; CHECK-NEXT: .long _property_access3
; CHECK-NEXT: .long 24
; CHECK-NEXT: .long _anyreg_test1
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _anyreg_test2
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _patchpoint_spilldef
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _patchpoint_spillargs
; CHECK-NEXT: .long 88
; Num Constants ; Num Constants
; CHECK-NEXT: .long 0 ; CHECK-NEXT: .long 0
; Num Callsites ; Num Callsites
; CHECK-NEXT: .long 8 ; CHECK-NEXT: .long 8
; Functions and stack size
; CHECK-NEXT: .quad _test
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _property_access1
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _property_access2
; CHECK-NEXT: .quad 24
; CHECK-NEXT: .quad _property_access3
; CHECK-NEXT: .quad 24
; CHECK-NEXT: .quad _anyreg_test1
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _anyreg_test2
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _patchpoint_spilldef
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _patchpoint_spillargs
; CHECK-NEXT: .quad 88
; No constants
; Callsites
; test ; test
; CHECK-LABEL: .long L{{.*}}-_test ; CHECK-LABEL: .long L{{.*}}-_test
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0

View File

@@ -6,17 +6,23 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps: ; CHECK-NEXT: __LLVM_StackMaps:
; CHECK-NEXT: .long 0 ; Header
; CHECK-NEXT: .byte 1
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .short 0
; Num Functions ; Num Functions
; CHECK-NEXT: .long 2 ; CHECK-NEXT: .long 2
; CHECK-NEXT: .long _stackmap_liveness
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _mixed_liveness
; CHECK-NEXT: .long 8
; Num LargeConstants ; Num LargeConstants
; CHECK-NEXT: .long 0 ; CHECK-NEXT: .long 0
; Num Callsites ; Num Callsites
; CHECK-NEXT: .long 5 ; CHECK-NEXT: .long 5
; Functions and stack size
; CHECK-NEXT: .quad _stackmap_liveness
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _mixed_liveness
; CHECK-NEXT: .quad 8
define void @stackmap_liveness() { define void @stackmap_liveness() {
entry: entry:
%a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
@@ -24,13 +30,19 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Padding
; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Align
; CHECK-NEXT: .align 3
; StackMap 1 (stackmap liveness information enabled) ; StackMap 1 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Padding
; STACK-NEXT: .short 0
; Num LiveOut Entries: 2 ; Num LiveOut Entries: 2
; STACK-NEXT: .short 2 ; STACK-NEXT: .short 2
; LiveOut Entry 1: %RSP (8 bytes) ; LiveOut Entry 1: %RSP (8 bytes)
@@ -41,13 +53,19 @@ entry:
; STACK-NEXT: .short 19 ; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16 ; STACK-NEXT: .byte 16
; Align
; STACK-NEXT: .align 3
; StackMap 1 (patchpoint liveness information enabled) ; StackMap 1 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Padding
; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Align
; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 5) call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 5)
%a2 = call i64 asm sideeffect "", "={r8}"() nounwind %a2 = call i64 asm sideeffect "", "={r8}"() nounwind
%a3 = call i8 asm sideeffect "", "={ah}"() nounwind %a3 = call i8 asm sideeffect "", "={ah}"() nounwind
@@ -58,16 +76,22 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Padding
; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Align
; CHECK-NEXT: .align 3
; StackMap 2 (stackmap liveness information enabled) ; StackMap 2 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Padding
; STACK-NEXT: .short 0
; Num LiveOut Entries: 6 ; Num LiveOut Entries: 6
; STACK-NEXT: .short 6 ; STACK-NEXT: .short 6
; LiveOut Entry 2: %RAX (1 bytes) --> %AL or %AH ; LiveOut Entry 1: %RAX (1 bytes) --> %AL or %AH
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 1 ; STACK-NEXT: .byte 1
@@ -75,29 +99,35 @@ entry:
; STACK-NEXT: .short 7 ; STACK-NEXT: .short 7
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8 ; STACK-NEXT: .byte 8
; LiveOut Entry 2: %R8 (8 bytes) ; LiveOut Entry 3: %R8 (8 bytes)
; STACK-NEXT: .short 8 ; STACK-NEXT: .short 8
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8 ; STACK-NEXT: .byte 8
; LiveOut Entry 2: %YMM0 (32 bytes) ; LiveOut Entry 4: %YMM0 (32 bytes)
; STACK-NEXT: .short 17 ; STACK-NEXT: .short 17
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 32 ; STACK-NEXT: .byte 32
; LiveOut Entry 2: %YMM1 (32 bytes) ; LiveOut Entry 5: %YMM1 (32 bytes)
; STACK-NEXT: .short 18 ; STACK-NEXT: .short 18
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 32 ; STACK-NEXT: .byte 32
; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2 ; LiveOut Entry 6: %YMM2 (16 bytes) --> %XMM2
; STACK-NEXT: .short 19 ; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16 ; STACK-NEXT: .byte 16
; Align
; STACK-NEXT: .align 3
; StackMap 2 (patchpoint liveness information enabled) ; StackMap 2 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Padding
; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Align
; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 2, i32 5) call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 2, i32 5)
call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind call void asm sideeffect "", "{r8},{ah},{ymm0},{ymm1}"(i64 %a2, i8 %a3, <4 x double> %a4, <4 x double> %a5) nounwind
@@ -105,16 +135,22 @@ entry:
; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness ; CHECK-LABEL: .long L{{.*}}-_stackmap_liveness
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Padding
; CHECK-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; CHECK-NEXT: .short 0 ; CHECK-NEXT: .short 0
; Align
; CHECK-NEXT: .align 3
; StackMap 3 (stackmap liveness information enabled) ; StackMap 3 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_stackmap_liveness ; STACK-LABEL: .long L{{.*}}-_stackmap_liveness
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Padding
; STACK-NEXT: .short 0
; Num LiveOut Entries: 2 ; Num LiveOut Entries: 2
; STACK-NEXT: .short 2 ; STACK-NEXT: .short 2
; LiveOut Entry 2: %RSP (8 bytes) ; LiveOut Entry 1: %RSP (8 bytes)
; STACK-NEXT: .short 7 ; STACK-NEXT: .short 7
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 8 ; STACK-NEXT: .byte 8
@@ -122,13 +158,19 @@ entry:
; STACK-NEXT: .short 19 ; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16 ; STACK-NEXT: .byte 16
; Align
; STACK-NEXT: .align 3
; StackMap 3 (patchpoint liveness information enabled) ; StackMap 3 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness ; PATCH-LABEL: .long L{{.*}}-_stackmap_liveness
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Padding
; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Align
; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 5) call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 5)
call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
ret void ret void
@@ -141,39 +183,58 @@ entry:
; STACK-LABEL: .long L{{.*}}-_mixed_liveness ; STACK-LABEL: .long L{{.*}}-_mixed_liveness
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Padding
; STACK-NEXT: .short 0
; Num LiveOut Entries: 1 ; Num LiveOut Entries: 1
; STACK-NEXT: .short 1 ; STACK-NEXT: .short 1
; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2 ; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
; STACK-NEXT: .short 19 ; STACK-NEXT: .short 19
; STACK-NEXT: .byte 0 ; STACK-NEXT: .byte 0
; STACK-NEXT: .byte 16 ; STACK-NEXT: .byte 16
; Align
; STACK-NEXT: .align 3
; StackMap 5 (stackmap liveness information enabled) ; StackMap 5 (stackmap liveness information enabled)
; STACK-LABEL: .long L{{.*}}-_mixed_liveness ; STACK-LABEL: .long L{{.*}}-_mixed_liveness
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Padding
; STACK-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; STACK-NEXT: .short 0 ; STACK-NEXT: .short 0
; Align
; STACK-NEXT: .align 3
; StackMap 4 (patchpoint liveness information enabled) ; StackMap 4 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_mixed_liveness ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Padding
; PATCH-NEXT: .short 0
; Num LiveOut Entries: 0 ; Num LiveOut Entries: 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Align
; PATCH-NEXT: .align 3
; StackMap 5 (patchpoint liveness information enabled) ; StackMap 5 (patchpoint liveness information enabled)
; PATCH-LABEL: .long L{{.*}}-_mixed_liveness ; PATCH-LABEL: .long L{{.*}}-_mixed_liveness
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; PATCH-NEXT: .short 0 ; PATCH-NEXT: .short 0
; Padding
; PATCH-NEXT: .short 0
; Num LiveOut Entries: 2 ; Num LiveOut Entries: 2
; PATCH-NEXT: .short 2 ; PATCH-NEXT: .short 2
; LiveOut Entry 1: %RSP (8 bytes) ; LiveOut Entry 1: %RSP (8 bytes)
; PATCH-NEXT: .short 7 ; PATCH-NEXT: .short 7
; PATCH-NEXT: .byte 0 ; PATCH-NEXT: .byte 0
; PATCH-NEXT: .byte 8 ; PATCH-NEXT: .byte 8
; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2 ; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
; PATCH-NEXT: .short 19 ; PATCH-NEXT: .short 19
; PATCH-NEXT: .byte 0 ; PATCH-NEXT: .byte 0
; PATCH-NEXT: .byte 16 ; PATCH-NEXT: .byte 16
; Align
; PATCH-NEXT: .align 3
call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 4, i32 5) call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 4, i32 5)
call anyregcc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 5, i32 0, i8* null, i32 0) call anyregcc void (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.void(i64 5, i32 0, i8* null, i32 0)
call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind

View File

@@ -4,47 +4,55 @@
; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps ; CHECK-LABEL: .section __LLVM_STACKMAPS,__llvm_stackmaps
; CHECK-NEXT: __LLVM_StackMaps: ; CHECK-NEXT: __LLVM_StackMaps:
; CHECK-NEXT: .long 0 ; Header
; CHECK-NEXT: .byte 1
; CHECK-NEXT: .byte 0
; CHECK-NEXT: .short 0
; Num Functions ; Num Functions
; CHECK-NEXT: .long 15 ; CHECK-NEXT: .long 15
; CHECK-NEXT: .long _constantargs
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _osrinline
; CHECK-NEXT: .long 24
; CHECK-NEXT: .long _osrcold
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _propertyRead
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _propertyWrite
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _jsVoidCall
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _jsIntCall
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _spilledValue
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _spilledStackMapValue
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _spillSubReg
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _subRegOffset
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _liveConstant
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _directFrameIdx
; CHECK-NEXT: .long 56
; CHECK-NEXT: .long _longid
; CHECK-NEXT: .long 8
; CHECK-NEXT: .long _clobberScratch
; CHECK-NEXT: .long 56
; Num LargeConstants ; Num LargeConstants
; CHECK-NEXT: .long 3 ; CHECK-NEXT: .long 3
; Num Callsites
; CHECK-NEXT: .long 19
; Functions and stack size
; CHECK-NEXT: .quad _constantargs
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _osrinline
; CHECK-NEXT: .quad 24
; CHECK-NEXT: .quad _osrcold
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _propertyRead
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _propertyWrite
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _jsVoidCall
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _jsIntCall
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _spilledValue
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _spilledStackMapValue
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _spillSubReg
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _subRegOffset
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _liveConstant
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _directFrameIdx
; CHECK-NEXT: .quad 56
; CHECK-NEXT: .quad _longid
; CHECK-NEXT: .quad 8
; CHECK-NEXT: .quad _clobberScratch
; CHECK-NEXT: .quad 56
; Large Constants
; CHECK-NEXT: .quad 2147483648 ; CHECK-NEXT: .quad 2147483648
; CHECK-NEXT: .quad 4294967295 ; CHECK-NEXT: .quad 4294967295
; CHECK-NEXT: .quad 4294967296 ; CHECK-NEXT: .quad 4294967296
; Num Callsites
; CHECK-NEXT: .long 19
; Callsites
; Constant arguments ; Constant arguments
; ;
; CHECK-NEXT: .quad 1 ; CHECK-NEXT: .quad 1