1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -aarch64-min-jump-table-entries=4 -mtriple=arm64-apple-ios < %s | FileCheck %s
4 ; Check there's no assert in spilling from implicit-def operands on an
7 define void @widget(i32 %arg, i32 %arg1, ptr %arg2, ptr %arg3, ptr %arg4, i32 %arg5, i1 %arg6) {
9 ; CHECK: ; %bb.0: ; %bb
10 ; CHECK-NEXT: sub sp, sp, #144
11 ; CHECK-NEXT: stp x28, x27, [sp, #48] ; 16-byte Folded Spill
12 ; CHECK-NEXT: stp x26, x25, [sp, #64] ; 16-byte Folded Spill
13 ; CHECK-NEXT: stp x24, x23, [sp, #80] ; 16-byte Folded Spill
14 ; CHECK-NEXT: stp x22, x21, [sp, #96] ; 16-byte Folded Spill
15 ; CHECK-NEXT: stp x20, x19, [sp, #112] ; 16-byte Folded Spill
16 ; CHECK-NEXT: stp x29, x30, [sp, #128] ; 16-byte Folded Spill
17 ; CHECK-NEXT: .cfi_def_cfa_offset 144
18 ; CHECK-NEXT: .cfi_offset w30, -8
19 ; CHECK-NEXT: .cfi_offset w29, -16
20 ; CHECK-NEXT: .cfi_offset w19, -24
21 ; CHECK-NEXT: .cfi_offset w20, -32
22 ; CHECK-NEXT: .cfi_offset w21, -40
23 ; CHECK-NEXT: .cfi_offset w22, -48
24 ; CHECK-NEXT: .cfi_offset w23, -56
25 ; CHECK-NEXT: .cfi_offset w24, -64
26 ; CHECK-NEXT: .cfi_offset w25, -72
27 ; CHECK-NEXT: .cfi_offset w26, -80
28 ; CHECK-NEXT: .cfi_offset w27, -88
29 ; CHECK-NEXT: .cfi_offset w28, -96
30 ; CHECK-NEXT: mov w19, w6
31 ; CHECK-NEXT: mov w20, w5
32 ; CHECK-NEXT: mov x21, x4
33 ; CHECK-NEXT: mov x22, x3
34 ; CHECK-NEXT: mov x23, x2
35 ; CHECK-NEXT: mov w24, w1
36 ; CHECK-NEXT: mov w25, w0
37 ; CHECK-NEXT: mov w26, w1
39 ; CHECK-NEXT: adrp x27, LJTI0_0@PAGE
41 ; CHECK-NEXT: add x27, x27, LJTI0_0@PAGEOFF
42 ; CHECK-NEXT: mov w28, #1 ; =0x1
43 ; CHECK-NEXT: ; implicit-def: $w8
44 ; CHECK-NEXT: str x8, [sp, #40] ; 8-byte Folded Spill
45 ; CHECK-NEXT: b LBB0_2
46 ; CHECK-NEXT: LBB0_1: ; %bb10
47 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
48 ; CHECK-NEXT: mov w0, w20
49 ; CHECK-NEXT: mov x1, x22
50 ; CHECK-NEXT: str wzr, [x21]
51 ; CHECK-NEXT: bl _putc
52 ; CHECK-NEXT: mov w0, w25
53 ; CHECK-NEXT: mov x1, xzr
54 ; CHECK-NEXT: bl _putc
55 ; CHECK-NEXT: LBB0_2: ; %bb8
56 ; CHECK-NEXT: ; =>This Inner Loop Header: Depth=1
57 ; CHECK-NEXT: cmp w24, #39
58 ; CHECK-NEXT: b.hi LBB0_5
59 ; CHECK-NEXT: ; %bb.3: ; %bb8
60 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
61 ; CHECK-NEXT: adr x8, LBB0_1
62 ; CHECK-NEXT: ldrb w9, [x27, x26]
63 ; CHECK-NEXT: add x8, x8, x9, lsl #2
65 ; CHECK-NEXT: LBB0_4: ; %bb9
66 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
67 ; CHECK-NEXT: str w28, [x23]
68 ; CHECK-NEXT: b LBB0_2
69 ; CHECK-NEXT: LBB0_5: ; %bb8
70 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
71 ; CHECK-NEXT: cmp w24, #64
72 ; CHECK-NEXT: b.ne LBB0_2
73 ; CHECK-NEXT: b LBB0_9
74 ; CHECK-NEXT: LBB0_6: ; %bb13
75 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
76 ; CHECK-NEXT: mov w8, #1 ; =0x1
77 ; CHECK-NEXT: str x8, [sp, #40] ; 8-byte Folded Spill
78 ; CHECK-NEXT: tbz w19, #0, LBB0_2
79 ; CHECK-NEXT: ; %bb.7: ; %bb14
80 ; CHECK-NEXT: ; in Loop: Header=BB0_2 Depth=1
81 ; CHECK-NEXT: mov x0, xzr
82 ; CHECK-NEXT: mov x1, xzr
83 ; CHECK-NEXT: mov w8, #1 ; =0x1
84 ; CHECK-NEXT: stp xzr, xzr, [sp]
85 ; CHECK-NEXT: stp x8, xzr, [sp, #16]
86 ; CHECK-NEXT: bl _fprintf
87 ; CHECK-NEXT: b LBB0_2
88 ; CHECK-NEXT: LBB0_8: ; %bb12
89 ; CHECK-NEXT: ; =>This Inner Loop Header: Depth=1
90 ; CHECK-NEXT: b LBB0_8
91 ; CHECK-NEXT: LBB0_9: ; %bb16
92 ; CHECK-NEXT: ldr x8, [sp, #40] ; 8-byte Folded Reload
93 ; CHECK-NEXT: mov x0, xzr
94 ; CHECK-NEXT: mov x1, xzr
95 ; CHECK-NEXT: ; kill: def $w8 killed $w8 killed $x8 def $x8
96 ; CHECK-NEXT: str x8, [sp]
97 ; CHECK-NEXT: bl _fprintf
98 ; CHECK-NEXT: brk #0x1
99 ; CHECK-NEXT: .loh AdrpAdd Lloh0, Lloh1
100 ; CHECK-NEXT: .cfi_endproc
101 ; CHECK-NEXT: .section __TEXT,__const
102 ; CHECK-NEXT: LJTI0_0:
103 ; CHECK-NEXT: .byte (LBB0_6-LBB0_1)>>2
104 ; CHECK-NEXT: .byte (LBB0_8-LBB0_1)>>2
105 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
106 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
107 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
108 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
109 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
110 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
111 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
112 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
113 ; CHECK-NEXT: .byte (LBB0_4-LBB0_1)>>2
114 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
115 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
116 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
117 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
118 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
119 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
120 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
121 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
122 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
123 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
124 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
125 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
126 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
127 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
128 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
129 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
130 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
131 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
132 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
133 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
134 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
135 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
136 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
137 ; CHECK-NEXT: .byte (LBB0_1-LBB0_1)>>2
138 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
139 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
140 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
141 ; CHECK-NEXT: .byte (LBB0_2-LBB0_1)>>2
142 ; CHECK-NEXT: .byte (LBB0_1-LBB0_1)>>2
146 bb7: ; preds = %bb14, %bb13, %bb
147 %phi = phi i32 [ poison, %bb ], [ %mul, %bb14 ], [ %mul, %bb13 ]
150 bb8: ; preds = %bb10, %bb9, %bb8, %bb7
151 switch i32 %arg1, label %bb8 [
161 store i32 1, ptr %arg2, align 4
164 bb10: ; preds = %bb8, %bb8
165 store i32 0, ptr %arg4, align 4
166 %call = tail call i32 @putc(i32 %arg5, ptr %arg3)
167 %call11 = tail call i32 @putc(i32 %arg, ptr null)
170 bb12: ; preds = %bb12, %bb8
175 br i1 %arg6, label %bb14, label %bb7
177 bb14: ; preds = %bb13
178 %call15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr null, ptr null, ptr null, i32 0, i32 %mul, ptr null)
182 %call17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr null, ptr null, i32 %phi)
186 declare i32 @fprintf(ptr, ptr, ...)
187 declare i32 @putc(i32, ptr)