File: localvar.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (312 lines) | stat: -rw-r--r-- 10,794 bytes parent folder | download | duplicates (3)
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -mattr=+v < %s \
; RUN:   | FileCheck %s -check-prefix=RV64IV

define void @local_var_mf8() {
; RV64IV-LABEL: local_var_mf8:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -16
; RV64IV-NEXT:    .cfi_def_cfa_offset 16
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    vsetvli a0, zero, e8, mf8, ta, mu
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 16
; RV64IV-NEXT:    vle8.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 16
; RV64IV-NEXT:    vle8.v v8, (a0)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    add sp, sp, a0
; RV64IV-NEXT:    addi sp, sp, 16
; RV64IV-NEXT:    ret
  %local0 = alloca <vscale x 1 x i8>
  %local1 = alloca <vscale x 1 x i8>
  load volatile <vscale x 1 x i8>, <vscale x 1 x i8>* %local0
  load volatile <vscale x 1 x i8>, <vscale x 1 x i8>* %local1
  ret void
}

define void @local_var_m1() {
; RV64IV-LABEL: local_var_m1:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -16
; RV64IV-NEXT:    .cfi_def_cfa_offset 16
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 16
; RV64IV-NEXT:    vl1r.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 16
; RV64IV-NEXT:    vl1r.v v8, (a0)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    add sp, sp, a0
; RV64IV-NEXT:    addi sp, sp, 16
; RV64IV-NEXT:    ret
  %local0 = alloca <vscale x 8 x i8>
  %local1 = alloca <vscale x 8 x i8>
  load volatile <vscale x 8 x i8>, <vscale x 8 x i8>* %local0
  load volatile <vscale x 8 x i8>, <vscale x 8 x i8>* %local1
  ret void
}

define void @local_var_m2() {
; RV64IV-LABEL: local_var_m2:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -16
; RV64IV-NEXT:    .cfi_def_cfa_offset 16
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 16
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 16
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    add sp, sp, a0
; RV64IV-NEXT:    addi sp, sp, 16
; RV64IV-NEXT:    ret
  %local0 = alloca <vscale x 16 x i8>
  %local1 = alloca <vscale x 16 x i8>
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local0
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local1
  ret void
}

define void @local_var_m4() {
; RV64IV-LABEL: local_var_m4:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -32
; RV64IV-NEXT:    .cfi_def_cfa_offset 32
; RV64IV-NEXT:    sd ra, 24(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    sd s0, 16(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    .cfi_offset ra, -8
; RV64IV-NEXT:    .cfi_offset s0, -16
; RV64IV-NEXT:    addi s0, sp, 32
; RV64IV-NEXT:    .cfi_def_cfa s0, 0
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 3
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    andi sp, sp, -32
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 16
; RV64IV-NEXT:    vl4r.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 16
; RV64IV-NEXT:    vl4r.v v8, (a0)
; RV64IV-NEXT:    addi sp, s0, -32
; RV64IV-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    addi sp, sp, 32
; RV64IV-NEXT:    ret
  %local0 = alloca <vscale x 32 x i8>
  %local1 = alloca <vscale x 32 x i8>
  load volatile <vscale x 32 x i8>, <vscale x 32 x i8>* %local0
  load volatile <vscale x 32 x i8>, <vscale x 32 x i8>* %local1
  ret void
}

define void @local_var_m8() {
; RV64IV-LABEL: local_var_m8:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -64
; RV64IV-NEXT:    .cfi_def_cfa_offset 64
; RV64IV-NEXT:    sd ra, 56(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    sd s0, 48(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    .cfi_offset ra, -8
; RV64IV-NEXT:    .cfi_offset s0, -16
; RV64IV-NEXT:    addi s0, sp, 64
; RV64IV-NEXT:    .cfi_def_cfa s0, 0
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 4
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    andi sp, sp, -64
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 3
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 48
; RV64IV-NEXT:    vl8r.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 48
; RV64IV-NEXT:    vl8r.v v8, (a0)
; RV64IV-NEXT:    addi sp, s0, -64
; RV64IV-NEXT:    ld ra, 56(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    ld s0, 48(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    addi sp, sp, 64
; RV64IV-NEXT:    ret
  %local0 = alloca <vscale x 64 x i8>
  %local1 = alloca <vscale x 64 x i8>
  load volatile <vscale x 64 x i8>, <vscale x 64 x i8>* %local0
  load volatile <vscale x 64 x i8>, <vscale x 64 x i8>* %local1
  ret void
}

define void @local_var_m2_mix_local_scalar() {
; RV64IV-LABEL: local_var_m2_mix_local_scalar:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -32
; RV64IV-NEXT:    .cfi_def_cfa_offset 32
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    lw a0, 28(sp)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    addi a0, a0, 32
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    addi a0, sp, 32
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    lw a0, 24(sp)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    add sp, sp, a0
; RV64IV-NEXT:    addi sp, sp, 32
; RV64IV-NEXT:    ret
  %local_scalar0 = alloca i32
  %local0 = alloca <vscale x 16 x i8>
  %local1 = alloca <vscale x 16 x i8>
  %local_scalar1 = alloca i32
  load volatile i32, i32* %local_scalar0
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local0
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local1
  load volatile i32, i32* %local_scalar1
  ret void
}

define void @local_var_m2_with_varsize_object(i64 %n) {
; RV64IV-LABEL: local_var_m2_with_varsize_object:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -32
; RV64IV-NEXT:    .cfi_def_cfa_offset 32
; RV64IV-NEXT:    sd ra, 24(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    sd s0, 16(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    .cfi_offset ra, -8
; RV64IV-NEXT:    .cfi_offset s0, -16
; RV64IV-NEXT:    addi s0, sp, 32
; RV64IV-NEXT:    .cfi_def_cfa s0, 0
; RV64IV-NEXT:    csrr a1, vlenb
; RV64IV-NEXT:    slli a1, a1, 2
; RV64IV-NEXT:    sub sp, sp, a1
; RV64IV-NEXT:    addi a0, a0, 15
; RV64IV-NEXT:    andi a0, a0, -16
; RV64IV-NEXT:    sub a0, sp, a0
; RV64IV-NEXT:    mv sp, a0
; RV64IV-NEXT:    csrr a1, vlenb
; RV64IV-NEXT:    slli a1, a1, 1
; RV64IV-NEXT:    sub a1, s0, a1
; RV64IV-NEXT:    addi a1, a1, -32
; RV64IV-NEXT:    call notdead@plt
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    sub a0, s0, a0
; RV64IV-NEXT:    addi a0, a0, -32
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 2
; RV64IV-NEXT:    sub a0, s0, a0
; RV64IV-NEXT:    addi a0, a0, -32
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    addi sp, s0, -32
; RV64IV-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    addi sp, sp, 32
; RV64IV-NEXT:    ret
  %1 = alloca i8, i64 %n
  %2 = alloca <vscale x 16 x i8>
  %3 = alloca <vscale x 16 x i8>
  call void @notdead(i8* %1, <vscale x 16 x i8>* %2)
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %2
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %3
  ret void
}

define void @local_var_m2_with_bp(i64 %n) {
; RV64IV-LABEL: local_var_m2_with_bp:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -256
; RV64IV-NEXT:    .cfi_def_cfa_offset 256
; RV64IV-NEXT:    sd ra, 248(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    sd s0, 240(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    sd s1, 232(sp) # 8-byte Folded Spill
; RV64IV-NEXT:    .cfi_offset ra, -8
; RV64IV-NEXT:    .cfi_offset s0, -16
; RV64IV-NEXT:    .cfi_offset s1, -24
; RV64IV-NEXT:    addi s0, sp, 256
; RV64IV-NEXT:    .cfi_def_cfa s0, 0
; RV64IV-NEXT:    csrr a1, vlenb
; RV64IV-NEXT:    slli a1, a1, 2
; RV64IV-NEXT:    sub sp, sp, a1
; RV64IV-NEXT:    andi sp, sp, -128
; RV64IV-NEXT:    mv s1, sp
; RV64IV-NEXT:    addi a0, a0, 15
; RV64IV-NEXT:    andi a0, a0, -16
; RV64IV-NEXT:    sub a0, sp, a0
; RV64IV-NEXT:    mv sp, a0
; RV64IV-NEXT:    addi a1, s1, 128
; RV64IV-NEXT:    csrr a2, vlenb
; RV64IV-NEXT:    slli a2, a2, 1
; RV64IV-NEXT:    add a2, s1, a2
; RV64IV-NEXT:    addi a2, a2, 232
; RV64IV-NEXT:    call notdead2@plt
; RV64IV-NEXT:    lw a0, 124(s1)
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 1
; RV64IV-NEXT:    add a0, s1, a0
; RV64IV-NEXT:    addi a0, a0, 232
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    addi a0, s1, 232
; RV64IV-NEXT:    vl2r.v v8, (a0)
; RV64IV-NEXT:    lw a0, 120(s1)
; RV64IV-NEXT:    addi sp, s0, -256
; RV64IV-NEXT:    ld ra, 248(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    ld s0, 240(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    ld s1, 232(sp) # 8-byte Folded Reload
; RV64IV-NEXT:    addi sp, sp, 256
; RV64IV-NEXT:    ret
  %1 = alloca i8, i64 %n
  %2 = alloca i32, align 128
  %local_scalar0 = alloca i32
  %local0 = alloca <vscale x 16 x i8>
  %local1 = alloca <vscale x 16 x i8>
  %local_scalar1 = alloca i32
  call void @notdead2(i8* %1, i32* %2, <vscale x 16 x i8>* %local0)
  load volatile i32, i32* %local_scalar0
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local0
  load volatile <vscale x 16 x i8>, <vscale x 16 x i8>* %local1
  load volatile i32, i32* %local_scalar1
  ret void
}

define i64 @fixed_object(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) nounwind {
; RV64IV-LABEL: fixed_object:
; RV64IV:       # %bb.0:
; RV64IV-NEXT:    addi sp, sp, -16
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 3
; RV64IV-NEXT:    sub sp, sp, a0
; RV64IV-NEXT:    csrr a0, vlenb
; RV64IV-NEXT:    slli a0, a0, 3
; RV64IV-NEXT:    add a0, sp, a0
; RV64IV-NEXT:    ld a0, 16(a0)
; RV64IV-NEXT:    csrr a1, vlenb
; RV64IV-NEXT:    slli a1, a1, 3
; RV64IV-NEXT:    add sp, sp, a1
; RV64IV-NEXT:    addi sp, sp, 16
; RV64IV-NEXT:    ret
  %fixed_size = alloca i32
  %rvv_vector = alloca <vscale x 8 x i64>, align 8
  ret i64 %8
}

declare void @notdead(i8*, <vscale x 16 x i8>*)
declare void @notdead2(i8*, i32*, <vscale x 16 x i8>*)