1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
; RUN: llc < %s | FileCheck %s
; RUN: llc -O3 < %s | FileCheck %s
; RUN: llc -O3 -debug-only=stackmaps < %s 2>&1 | FileCheck -check-prefix=STACKMAPS %s
; REQUIRES: asserts
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
; STACKMAPS: Stack Maps: callsite 2882400015
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 4242
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 4243
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 16 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 16]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 2882400015
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 2 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 2]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 2882400015
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 3 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 3]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 4243
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 55 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 55]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
declare i32 @callee_0()
declare i32 @callee_1(i32)
declare i32 @callee_vararg(...)
define i32 @caller_0() {
; CHECK-LABEL: _caller_0
entry:
%v = call i32 @callee_0() [ "deopt"(i32 0) ]
%v2 = add i32 %v, 1
ret i32 %v2
; CHECK: callq _callee_0
; CHECK: incl %eax
; CHECK: retq
}
define i32 @caller_1() {
; CHECK-LABEL: _caller_1
entry:
%v = call i32 @callee_1(i32 42) "statepoint-id"="4242" [ "deopt"(i32 1) ]
ret i32 %v
; CHECK: callq _callee_1
; CHECK: popq %rcx
; CHECK: retq
}
define i32 @caller_vararg() {
; CHECK-LABEL: _caller_vararg
entry:
; CHECK: movb $1, %al
; CHECK: callq _callee_vararg
%v = call i32(...) @callee_vararg(i32 42, double 500.0) "statepoint-id"="4243" [ "deopt"(i32 16) ]
ret i32 %v
}
define i32 @invoker_0() personality i8 0 {
; CHECK-LABEL: _invoker_0
entry:
%v = invoke i32 @callee_0() [ "deopt"(i32 2) ]
to label %normal unwind label %uw
normal:
ret i32 %v
uw:
%ehvals = landingpad { ptr, i32 }
cleanup
ret i32 1
; CHECK: callq _callee_0
; CHECK: popq %rcx
; CHECK: retq
; CHECK: movl $1, %eax
; CHECK: popq %rcx
; CHECK: retq
}
define i32 @invoker_1() personality i8 0 {
; CHECK-LABEL: _invoker_1
entry:
%v = invoke i32 @callee_1(i32 45) "statepoint-num-patch-bytes"="9" [ "deopt"(i32 3) ]
to label %normal unwind label %uw
normal:
ret i32 %v
uw:
%ehvals = landingpad { ptr, i32 }
cleanup
ret i32 1
; CHECK: movl $45, %edi
; CHECK: nopw 512(%rax,%rax)
; CHECK: popq %rcx
; CHECK: retq
; CHECK: movl $1, %eax
; CHECK: popq %rcx
; CHECK: retq
}
define i32 @invoker_2() personality ptr @__CxxFrameHandler3 {
entry:
%val = invoke i32 @callee_1(i32 1)
to label %try.cont unwind label %catch.dispatch
catch.dispatch:
%cs1 = catchswitch within none [label %catch] unwind to caller
catch:
%cp1 = catchpad within %cs1 [ptr null, i32 64, ptr null]
%val2 = call i32 @callee_1(i32 100) "statepoint-id"="4243" [ "funclet"(token %cp1), "deopt"(i32 55) ]
catchret from %cp1 to label %try.cont
try.cont:
ret i32 0
}
declare i32 @__CxxFrameHandler3(...)
define void @f_0(i64 %n) {
; CHECK-LABEL: _f_0
%s = alloca i64
%vl = alloca i64, i64 %n
; Check that the stackmap does not reference %s through
; SP since the offset is not static because of %vl.
; STACKMAPS: Loc 3: Direct 6
call void @g_0(ptr %vl) [ "deopt"(ptr %s) ]
ret void
}
declare void @g_0(ptr %vl)
define void @vector_deopt_bundle(<32 x ptr addrspace(1)> %val) {
; CHECK-LABEL: _vector_deopt_bundle:
; CHECK: movaps 16(%rbp), %xmm8
; CHECK-NEXT: movaps 32(%rbp), %xmm9
; CHECK-NEXT: movaps 48(%rbp), %xmm10
; CHECK-NEXT: movaps 64(%rbp), %xmm11
; CHECK-NEXT: movaps 80(%rbp), %xmm12
; CHECK-NEXT: movaps 96(%rbp), %xmm13
; CHECK-NEXT: movaps 112(%rbp), %xmm14
; CHECK-NEXT: movaps 128(%rbp), %xmm15
; CHECK-NEXT: movaps %xmm15, 240(%rsp)
; CHECK-NEXT: movaps %xmm14, 224(%rsp)
; CHECK-NEXT: movaps %xmm13, 208(%rsp)
; CHECK-NEXT: movaps %xmm12, 192(%rsp)
; CHECK-NEXT: movaps %xmm11, 176(%rsp)
; CHECK-NEXT: movaps %xmm10, 160(%rsp)
; CHECK-NEXT: movaps %xmm9, 144(%rsp)
; CHECK-NEXT: movaps %xmm8, 128(%rsp)
; CHECK-NEXT: movaps %xmm7, 112(%rsp)
; CHECK-NEXT: movaps %xmm6, 96(%rsp)
; CHECK-NEXT: movaps %xmm5, 80(%rsp)
; CHECK-NEXT: movaps %xmm4, 64(%rsp)
; CHECK-NEXT: movaps %xmm3, 48(%rsp)
; CHECK-NEXT: movaps %xmm2, 32(%rsp)
; CHECK-NEXT: movaps %xmm1, 16(%rsp)
; CHECK-NEXT: movaps %xmm0, (%rsp)
call void @unknown() [ "deopt"(<32 x ptr addrspace(1)> %val) ]
ret void
; STACKMAPS: Stack Maps: callsite 2882400015
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 0, .short 8, .short 0, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Indirect 7+0 [encoding: .byte 3, .byte 0, .short 256, .short 7, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
}
declare void @unknown()
|