Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7                             | FileCheck %s
      2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -fast-isel -fast-isel-abort=1 | FileCheck %s
      3 
      4 ; CHECK-LABEL:  .section  __LLVM_STACKMAPS,__llvm_stackmaps
      5 ; CHECK-NEXT:  __LLVM_StackMaps:
      6 ; Header
      7 ; CHECK-NEXT:   .byte 1
      8 ; CHECK-NEXT:   .byte 0
      9 ; CHECK-NEXT:   .short 0
     10 ; Num Functions
     11 ; CHECK-NEXT:   .long 4
     12 ; Num LargeConstants
     13 ; CHECK-NEXT:   .long 3
     14 ; Num Callsites
     15 ; CHECK-NEXT:   .long 7
     16 
     17 ; Functions and stack size
     18 ; CHECK-NEXT:   .quad _constantargs
     19 ; CHECK-NEXT:   .quad 8
     20 ; CHECK-NEXT:   .quad _liveConstant
     21 ; CHECK-NEXT:   .quad 8
     22 ; CHECK-NEXT:   .quad _directFrameIdx
     23 ; CHECK-NEXT:   .quad 40
     24 ; CHECK-NEXT:   .quad _longid
     25 ; CHECK-NEXT:   .quad 8
     26 
     27 ; Large Constants
     28 ; CHECK-NEXT:   .quad   2147483648
     29 ; CHECK-NEXT:   .quad   4294967295
     30 ; CHECK-NEXT:   .quad   4294967296
     31 
     32 ; Callsites
     33 ; Constant arguments
     34 ;
     35 ; CHECK-NEXT:   .quad   1
     36 ; CHECK-NEXT:   .long   L{{.*}}-_constantargs
     37 ; CHECK-NEXT:   .short  0
     38 ; CHECK-NEXT:   .short  12
     39 ; SmallConstant
     40 ; CHECK-NEXT:   .byte   4
     41 ; CHECK-NEXT:   .byte   8
     42 ; CHECK-NEXT:   .short  0
     43 ; CHECK-NEXT:   .long   -1
     44 ; SmallConstant
     45 ; CHECK-NEXT:   .byte   4
     46 ; CHECK-NEXT:   .byte   8
     47 ; CHECK-NEXT:   .short  0
     48 ; CHECK-NEXT:   .long   -1
     49 ; SmallConstant
     50 ; CHECK-NEXT:   .byte   4
     51 ; CHECK-NEXT:   .byte   8
     52 ; CHECK-NEXT:   .short  0
     53 ; CHECK-NEXT:   .long   65536
     54 ; SmallConstant
     55 ; CHECK-NEXT:   .byte   4
     56 ; CHECK-NEXT:   .byte   8
     57 ; CHECK-NEXT:   .short  0
     58 ; CHECK-NEXT:   .long   2000000000
     59 ; SmallConstant
     60 ; CHECK-NEXT:   .byte   4
     61 ; CHECK-NEXT:   .byte   8
     62 ; CHECK-NEXT:   .short  0
     63 ; CHECK-NEXT:   .long   2147483647
     64 ; SmallConstant
     65 ; CHECK-NEXT:   .byte   4
     66 ; CHECK-NEXT:   .byte   8
     67 ; CHECK-NEXT:   .short  0
     68 ; CHECK-NEXT:   .long   -1
     69 ; SmallConstant
     70 ; CHECK-NEXT:   .byte   4
     71 ; CHECK-NEXT:   .byte   8
     72 ; CHECK-NEXT:   .short  0
     73 ; CHECK-NEXT:   .long   -1
     74 ; SmallConstant
     75 ; CHECK-NEXT:   .byte   4
     76 ; CHECK-NEXT:   .byte   8
     77 ; CHECK-NEXT:   .short  0
     78 ; CHECK-NEXT:   .long   0
     79 ; LargeConstant at index 0
     80 ; CHECK-NEXT:   .byte   5
     81 ; CHECK-NEXT:   .byte   8
     82 ; CHECK-NEXT:   .short  0
     83 ; CHECK-NEXT:   .long   0
     84 ; LargeConstant at index 1
     85 ; CHECK-NEXT:   .byte   5
     86 ; CHECK-NEXT:   .byte   8
     87 ; CHECK-NEXT:   .short  0
     88 ; CHECK-NEXT:   .long   1
     89 ; LargeConstant at index 2
     90 ; CHECK-NEXT:   .byte   5
     91 ; CHECK-NEXT:   .byte   8
     92 ; CHECK-NEXT:   .short  0
     93 ; CHECK-NEXT:   .long   2
     94 ; SmallConstant
     95 ; CHECK-NEXT:   .byte   4
     96 ; CHECK-NEXT:   .byte   8
     97 ; CHECK-NEXT:   .short  0
     98 ; CHECK-NEXT:   .long   -1
     99 
    100 define void @constantargs() {
    101 entry:
    102   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 15, i16 65535, i16 -1, i32 65536, i32 2000000000, i32 2147483647, i32 -1, i32 4294967295, i32 4294967296, i64 2147483648, i64 4294967295, i64 4294967296, i64 -1)
    103   ret void
    104 }
    105 
    106 ; Map a constant value.
    107 ;
    108 ; CHECK-LABEL:  .long L{{.*}}-_liveConstant
    109 ; CHECK-NEXT:   .short 0
    110 ; 1 location
    111 ; CHECK-NEXT:   .short 1
    112 ; Loc 0: SmallConstant
    113 ; CHECK-NEXT:   .byte   4
    114 ; CHECK-NEXT:   .byte   8
    115 ; CHECK-NEXT:   .short  0
    116 ; CHECK-NEXT:   .long   33
    117 
    118 define void @liveConstant() {
    119   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 15, i32 5, i32 33)
    120   ret void
    121 }
    122 
    123 ; Directly map an alloca's address.
    124 ;
    125 ; Callsite 16
    126 ; CHECK-LABEL:  .long L{{.*}}-_directFrameIdx
    127 ; CHECK-NEXT:   .short 0
    128 ; 1 location
    129 ; CHECK-NEXT:   .short	1
    130 ; Loc 0: Direct RBP - ofs
    131 ; CHECK-NEXT:   .byte	2
    132 ; CHECK-NEXT:   .byte	8
    133 ; CHECK-NEXT:   .short	6
    134 ; CHECK-NEXT:   .long
    135 
    136 define void @directFrameIdx() {
    137 entry:
    138   %metadata1 = alloca i64, i32 3, align 8
    139   store i64 11, i64* %metadata1
    140   store i64 12, i64* %metadata1
    141   store i64 13, i64* %metadata1
    142   call void (i64, i32, ...) @llvm.experimental.stackmap(i64 16, i32 0, i64* %metadata1)
    143   ret void
    144 }
    145 
    146 ; Test a 64-bit ID.
    147 ;
    148 ; CHECK:        .quad 4294967295
    149 ; CHECK-LABEL:  .long L{{.*}}-_longid
    150 ; CHECK:        .quad 4294967296
    151 ; CHECK-LABEL:  .long L{{.*}}-_longid
    152 ; CHECK:        .quad 9223372036854775807
    153 ; CHECK-LABEL:  .long L{{.*}}-_longid
    154 ; CHECK:        .quad -1
    155 ; CHECK-LABEL:  .long L{{.*}}-_longid
    156 define void @longid() {
    157 entry:
    158   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 4294967295, i32 0)
    159   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 4294967296, i32 0)
    160   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 9223372036854775807, i32 0)
    161   tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 -1, i32 0)
    162   ret void
    163 }
    164 
    165 declare void @llvm.experimental.stackmap(i64, i32, ...)
    166