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

Juergen Ributzka juergen at apple.com
Mon Mar 31 15:14:05 PDT 2014


Author: ributzka
Date: Mon Mar 31 17:14:04 2014
New Revision: 205254

URL: http://llvm.org/viewvc/llvm-project?rev=205254&view=rev
Log:
[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>

Modified:
    llvm/trunk/docs/StackMaps.rst
    llvm/trunk/include/llvm/CodeGen/StackMaps.h
    llvm/trunk/lib/CodeGen/StackMaps.cpp
    llvm/trunk/test/CodeGen/ARM64/anyregcc.ll
    llvm/trunk/test/CodeGen/ARM64/stackmap.ll
    llvm/trunk/test/CodeGen/X86/anyregcc.ll
    llvm/trunk/test/CodeGen/X86/stackmap-liveness.ll
    llvm/trunk/test/CodeGen/X86/stackmap.ll

Modified: llvm/trunk/docs/StackMaps.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/StackMaps.rst?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/docs/StackMaps.rst (original)
+++ llvm/trunk/docs/StackMaps.rst Mon Mar 31 17:14:04 2014
@@ -313,17 +313,21 @@ format of this section follows:
 
 .. code-block:: none
 
-  uint32 : Reserved (header)
+  Header {
+    uint8  : Stack Map Version (current version is 1)
+    uint8  : Reserved (expected to be 0)
+    uint16 : Reserved (expected to be 0)
+  }
   uint32 : NumFunctions
+  uint32 : NumConstants
+  uint32 : NumRecords
   StkSizeRecord[NumFunctions] {
-    uint32 : Function Offset
-    uint32 : Stack Size
+    uint64 : Function Address
+    uint64 : Stack Size
   }
-  uint32 : NumConstants
   Constants[NumConstants] {
     uint64 : LargeConstant
   }
-  uint32 : NumRecords
   StkMapRecord[NumRecords] {
     uint64 : PatchPoint ID
     uint32 : Instruction Offset
@@ -335,12 +339,14 @@ format of this section follows:
       uint16 : Dwarf RegNum
       int32  : Offset or SmallConstant
     }
+    uint16 : Padding
     uint16 : NumLiveOuts
     LiveOuts[NumLiveOuts]
       uint16 : Dwarf RegNum
       uint8  : Reserved
       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

Modified: llvm/trunk/include/llvm/CodeGen/StackMaps.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/StackMaps.h?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/StackMaps.h (original)
+++ llvm/trunk/include/llvm/CodeGen/StackMaps.h Mon Mar 31 17:14:04 2014
@@ -133,7 +133,7 @@ public:
 private:
   typedef SmallVector<Location, 8> LocationVec;
   typedef SmallVector<LiveOutReg, 8> LiveOutVec;
-  typedef MapVector<const MCSymbol *, uint32_t> FnStackSizeMap;
+  typedef MapVector<const MCSymbol *, uint64_t> FnStackSizeMap;
 
   struct CallsiteInfo {
     const MCExpr *CSOffsetExpr;

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

Modified: llvm/trunk/test/CodeGen/ARM64/anyregcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/anyregcc.ll?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/anyregcc.ll (original)
+++ llvm/trunk/test/CodeGen/ARM64/anyregcc.ll Mon Mar 31 17:14:04 2014
@@ -4,29 +4,34 @@
 ; CHECK-LABEL: .section	__LLVM_STACKMAPS,__llvm_stackmaps
 ; CHECK-NEXT:  __LLVM_StackMaps:
 ; Header
-; CHECK-NEXT:   .long   0
+; CHECK-NEXT:   .byte 1
+; CHECK-NEXT:   .byte 0
+; CHECK-NEXT:   .short 0
 ; Num Functions
 ; CHECK-NEXT:   .long 8
-; CHECK-NEXT:   .long _test
-; CHECK-NEXT:   .long 16
-; 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 LargeConstants
+; CHECK-NEXT:   .long 0
 ; 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
 ; CHECK-LABEL:  .long   L{{.*}}-_test

Modified: llvm/trunk/test/CodeGen/ARM64/stackmap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM64/stackmap.ll?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM64/stackmap.ll (original)
+++ llvm/trunk/test/CodeGen/ARM64/stackmap.ll Mon Mar 31 17:14:04 2014
@@ -8,37 +8,44 @@ target datalayout = "e-m:o-i64:64-f80:12
 
 ; CHECK-LABEL:  .section  __LLVM_STACKMAPS,__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
 ; 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
-; 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   4294967296
-; Num Callsites
-; CHECK-NEXT:   .long   11
 
 ; Constant arguments
 ;

Modified: llvm/trunk/test/CodeGen/X86/anyregcc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/anyregcc.ll?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/anyregcc.ll (original)
+++ llvm/trunk/test/CodeGen/X86/anyregcc.ll Mon Mar 31 17:14:04 2014
@@ -7,30 +7,37 @@
 ; CHECK-LABEL:  .section __LLVM_STACKMAPS,__llvm_stackmaps
 ; CHECK-NEXT:   __LLVM_StackMaps:
 ; Header
-; CHECK-NEXT:   .long 0
+; CHECK-NEXT:   .byte 1
+; CHECK-NEXT:   .byte 0
+; CHECK-NEXT:   .short 0
 ; Num Functions
 ; 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
-; CHECK-NEXT:   .long   0
+; CHECK-NEXT:   .long 0
 ; 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
 ; CHECK-LABEL:  .long   L{{.*}}-_test
 ; CHECK-NEXT:   .short  0

Modified: llvm/trunk/test/CodeGen/X86/stackmap-liveness.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stackmap-liveness.ll?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/stackmap-liveness.ll (original)
+++ llvm/trunk/test/CodeGen/X86/stackmap-liveness.ll Mon Mar 31 17:14:04 2014
@@ -6,17 +6,23 @@
 
 ; CHECK-LABEL:  .section  __LLVM_STACKMAPS,__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
 ; CHECK-NEXT:   .long 2
-; CHECK-NEXT:   .long _stackmap_liveness
-; CHECK-NEXT:   .long 8
-; CHECK-NEXT:   .long _mixed_liveness
-; CHECK-NEXT:   .long 8
 ; Num LargeConstants
 ; CHECK-NEXT:   .long   0
 ; Num Callsites
 ; 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() {
 entry:
   %a1 = call <2 x double> asm sideeffect "", "={xmm2}"() nounwind
@@ -24,13 +30,19 @@ entry:
 ; CHECK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; CHECK-NEXT:   .short  0
 ; CHECK-NEXT:   .short  0
+; Padding
+; CHECK-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; CHECK-NEXT:   .short  0
+; Align
+; CHECK-NEXT:   .align  3
 
 ; StackMap 1 (stackmap liveness information enabled)
 ; STACK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; STACK-NEXT:   .short  0
 ; STACK-NEXT:   .short  0
+; Padding
+; STACK-NEXT:   .short  0
 ; Num LiveOut Entries: 2
 ; STACK-NEXT:   .short  2
 ; LiveOut Entry 1: %RSP (8 bytes)
@@ -41,13 +53,19 @@ entry:
 ; STACK-NEXT:   .short  19
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 16
+; Align
+; STACK-NEXT:   .align  3
 
 ; StackMap 1 (patchpoint liveness information enabled)
 ; PATCH-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; PATCH-NEXT:   .short  0
 ; PATCH-NEXT:   .short  0
+; Padding
+; PATCH-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; PATCH-NEXT:   .short  0
+; Align
+; PATCH-NEXT:   .align  3
   call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 5)
   %a2 = call i64 asm sideeffect "", "={r8}"() nounwind
   %a3 = call i8 asm sideeffect "", "={ah}"() nounwind
@@ -58,16 +76,22 @@ entry:
 ; CHECK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; CHECK-NEXT:   .short  0
 ; CHECK-NEXT:   .short  0
+; Padding
+; CHECK-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; CHECK-NEXT:   .short  0
+; Align
+; CHECK-NEXT:   .align  3
 
 ; StackMap 2 (stackmap liveness information enabled)
 ; STACK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; STACK-NEXT:   .short  0
 ; STACK-NEXT:   .short  0
+; Padding
+; STACK-NEXT:   .short  0
 ; Num LiveOut Entries: 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:   .byte 0
 ; STACK-NEXT:   .byte 1
@@ -75,29 +99,35 @@ entry:
 ; STACK-NEXT:   .short  7
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 8
-; LiveOut Entry 2: %R8 (8 bytes)
+; LiveOut Entry 3: %R8 (8 bytes)
 ; STACK-NEXT:   .short  8
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 8
-; LiveOut Entry 2: %YMM0 (32 bytes)
+; LiveOut Entry 4: %YMM0 (32 bytes)
 ; STACK-NEXT:   .short  17
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 32
-; LiveOut Entry 2: %YMM1 (32 bytes)
+; LiveOut Entry 5: %YMM1 (32 bytes)
 ; STACK-NEXT:   .short  18
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 32
-; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
+; LiveOut Entry 6: %YMM2 (16 bytes) --> %XMM2
 ; STACK-NEXT:   .short  19
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 16
+; Align
+; STACK-NEXT:   .align  3
 
 ; StackMap 2 (patchpoint liveness information enabled)
 ; PATCH-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; PATCH-NEXT:   .short  0
 ; PATCH-NEXT:   .short  0
+; Padding
+; PATCH-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; PATCH-NEXT:   .short  0
+; Align
+; PATCH-NEXT:   .align  3
   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
 
@@ -105,16 +135,22 @@ entry:
 ; CHECK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; CHECK-NEXT:   .short  0
 ; CHECK-NEXT:   .short  0
+; Padding
+; CHECK-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; CHECK-NEXT:   .short  0
+; Align
+; CHECK-NEXT:   .align  3
 
 ; StackMap 3 (stackmap liveness information enabled)
 ; STACK-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; STACK-NEXT:   .short  0
 ; STACK-NEXT:   .short  0
+; Padding
+; STACK-NEXT:   .short  0
 ; Num LiveOut Entries: 2
 ; STACK-NEXT:   .short  2
-; LiveOut Entry 2: %RSP (8 bytes)
+; LiveOut Entry 1: %RSP (8 bytes)
 ; STACK-NEXT:   .short  7
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 8
@@ -122,13 +158,19 @@ entry:
 ; STACK-NEXT:   .short  19
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 16
+; Align
+; STACK-NEXT:   .align  3
 
 ; StackMap 3 (patchpoint liveness information enabled)
 ; PATCH-LABEL:  .long L{{.*}}-_stackmap_liveness
 ; PATCH-NEXT:   .short  0
 ; PATCH-NEXT:   .short  0
+; Padding
+; PATCH-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; PATCH-NEXT:   .short  0
+; Align
+; PATCH-NEXT:   .align  3
   call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 3, i32 5)
   call void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind
   ret void
@@ -141,39 +183,58 @@ entry:
 ; STACK-LABEL:  .long L{{.*}}-_mixed_liveness
 ; STACK-NEXT:   .short  0
 ; STACK-NEXT:   .short  0
+; Padding
+; STACK-NEXT:   .short  0
 ; Num LiveOut Entries: 1
 ; STACK-NEXT:   .short  1
 ; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
 ; STACK-NEXT:   .short  19
 ; STACK-NEXT:   .byte 0
 ; STACK-NEXT:   .byte 16
+; Align
+; STACK-NEXT:   .align  3
+
+
 ; StackMap 5 (stackmap liveness information enabled)
 ; STACK-LABEL:  .long L{{.*}}-_mixed_liveness
 ; STACK-NEXT:   .short  0
 ; STACK-NEXT:   .short  0
+; Padding
+; STACK-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; STACK-NEXT:   .short  0
+; Align
+; STACK-NEXT:   .align  3
 
 ; StackMap 4 (patchpoint liveness information enabled)
 ; PATCH-LABEL:  .long L{{.*}}-_mixed_liveness
 ; PATCH-NEXT:   .short  0
 ; PATCH-NEXT:   .short  0
+; Padding
+; PATCH-NEXT:   .short  0
 ; Num LiveOut Entries: 0
 ; PATCH-NEXT:   .short  0
+; Align
+; PATCH-NEXT:   .align  3
+
 ; StackMap 5 (patchpoint liveness information enabled)
 ; PATCH-LABEL:  .long L{{.*}}-_mixed_liveness
 ; PATCH-NEXT:   .short  0
 ; PATCH-NEXT:   .short  0
+; Padding
+; PATCH-NEXT:   .short  0
 ; Num LiveOut Entries: 2
 ; PATCH-NEXT:   .short  2
 ; LiveOut Entry 1: %RSP (8 bytes)
 ; PATCH-NEXT:   .short  7
 ; PATCH-NEXT:   .byte 0
 ; PATCH-NEXT:   .byte 8
-; LiveOut Entry 1: %YMM2 (16 bytes) --> %XMM2
+; LiveOut Entry 2: %YMM2 (16 bytes) --> %XMM2
 ; PATCH-NEXT:   .short  19
 ; PATCH-NEXT:   .byte 0
 ; PATCH-NEXT:   .byte 16
+; Align
+; PATCH-NEXT:   .align  3
   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 void asm sideeffect "", "{xmm2}"(<2 x double> %a1) nounwind

Modified: llvm/trunk/test/CodeGen/X86/stackmap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stackmap.ll?rev=205254&r1=205253&r2=205254&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/stackmap.ll (original)
+++ llvm/trunk/test/CodeGen/X86/stackmap.ll Mon Mar 31 17:14:04 2014
@@ -4,47 +4,55 @@
 
 ; CHECK-LABEL:  .section  __LLVM_STACKMAPS,__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
 ; 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
-; 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   4294967295
 ; CHECK-NEXT:   .quad   4294967296
-; Num Callsites
-; CHECK-NEXT:   .long   19
 
+; Callsites
 ; Constant arguments
 ;
 ; CHECK-NEXT:   .quad   1





More information about the llvm-commits mailing list