1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc %s -o - -mtriple=riscv64 -mattr=v \
3 # RUN: -run-pass=riscv-insert-vsetvli | FileCheck %s
6 source_filename = "vsetvli-insert.ll"
7 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
8 target triple = "riscv64"
10 define <vscale x 1 x i64> @load_add_or_sub(i8 zeroext %cond, <vscale x 1 x i64>* %0, <vscale x 1 x i64> %1, i64 %2) #0 {
12 %a = call <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64>* %0, i64 %2)
13 %tobool = icmp eq i8 %cond, 0
14 br i1 %tobool, label %if.else, label %if.then
16 if.then: ; preds = %entry
17 %b = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %a, <vscale x 1 x i64> %1, i64 %2)
20 if.else: ; preds = %entry
21 %c = call <vscale x 1 x i64> @llvm.riscv.vsub.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %a, <vscale x 1 x i64> %1, i64 %2)
24 if.end: ; preds = %if.else, %if.then
25 %d = phi <vscale x 1 x i64> [ %b, %if.then ], [ %c, %if.else ]
26 ret <vscale x 1 x i64> %d
29 define void @load_zext_or_sext(i8 zeroext %cond, <vscale x 1 x i32>* %0, <vscale x 1 x i64>* %1, i64 %2) #0 {
31 %a = call <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32.i64(<vscale x 1 x i32> undef, <vscale x 1 x i32>* %0, i64 %2)
32 %tobool = icmp eq i8 %cond, 0
33 br i1 %tobool, label %if.else, label %if.then
35 if.then: ; preds = %entry
36 %b = call <vscale x 1 x i64> @llvm.riscv.vzext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64> undef, <vscale x 1 x i32> %a, i64 %2)
39 if.else: ; preds = %entry
40 %c = call <vscale x 1 x i64> @llvm.riscv.vsext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64> undef, <vscale x 1 x i32> %a, i64 %2)
43 if.end: ; preds = %if.else, %if.then
44 %d = phi <vscale x 1 x i64> [ %b, %if.then ], [ %c, %if.else ]
45 call void @llvm.riscv.vse.nxv1i64.i64(<vscale x 1 x i64> %d, <vscale x 1 x i64>* %1, i64 %2)
49 declare i64 @llvm.riscv.vmv.x.s.nxv1i64(<vscale x 1 x i64>) #1
51 define i64 @vmv_x_s(i8 zeroext %cond, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %2) #0 {
53 %tobool = icmp eq i8 %cond, 0
54 br i1 %tobool, label %if.else, label %if.then
56 if.then: ; preds = %entry
57 %a = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %2)
60 if.else: ; preds = %entry
61 %b = call <vscale x 1 x i64> @llvm.riscv.vsub.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %1, <vscale x 1 x i64> %1, i64 %2)
64 if.end: ; preds = %if.else, %if.then
65 %c = phi <vscale x 1 x i64> [ %a, %if.then ], [ %b, %if.else ]
66 %d = call i64 @llvm.riscv.vmv.x.s.nxv1i64(<vscale x 1 x i64> %c)
70 declare i64 @llvm.riscv.vsetvli.i64(i64, i64 immarg, i64 immarg) #2
72 define <vscale x 1 x i64> @vsetvli_add_or_sub(i8 zeroext %cond, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %avl) #0 {
74 %vl = call i64 @llvm.riscv.vsetvli.i64(i64 %avl, i64 3, i64 0)
75 %tobool = icmp eq i8 %cond, 0
76 br i1 %tobool, label %if.else, label %if.then
78 if.then: ; preds = %entry
79 %b = call <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %vl)
82 if.else: ; preds = %entry
83 %c = call <vscale x 1 x i64> @llvm.riscv.vsub.nxv1i64.nxv1i64.i64(<vscale x 1 x i64> undef, <vscale x 1 x i64> %0, <vscale x 1 x i64> %1, i64 %vl)
86 if.end: ; preds = %if.else, %if.then
87 %d = phi <vscale x 1 x i64> [ %b, %if.then ], [ %c, %if.else ]
88 ret <vscale x 1 x i64> %d
91 define void @vsetvli_vcpop() {
95 define void @vsetvli_loop_store() {
99 define void @vsetvli_loop_store2() {
103 define void @redusum_loop(i32* nocapture noundef readonly %a, i32 noundef signext %n, i32* nocapture noundef writeonly %res) #0 {
105 br label %vector.body
107 vector.body: ; preds = %vector.body, %entry
108 %lsr.iv1 = phi i32* [ %scevgep, %vector.body ], [ %a, %entry ]
109 %lsr.iv = phi i64 [ %lsr.iv.next, %vector.body ], [ 2048, %entry ]
110 %vec.phi = phi <4 x i32> [ zeroinitializer, %entry ], [ %0, %vector.body ]
111 %lsr.iv12 = bitcast i32* %lsr.iv1 to <4 x i32>*
112 %wide.load = load <4 x i32>, <4 x i32>* %lsr.iv12, align 4
113 %0 = add <4 x i32> %wide.load, %vec.phi
114 %lsr.iv.next = add nsw i64 %lsr.iv, -4
115 %scevgep = getelementptr i32, i32* %lsr.iv1, i64 4
116 %1 = icmp eq i64 %lsr.iv.next, 0
117 br i1 %1, label %middle.block, label %vector.body
119 middle.block: ; preds = %vector.body
120 %2 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %0)
121 store i32 %2, i32* %res, align 4
125 define void @vsetvli_vluxei64_regression() {
129 define void @if_in_loop() {
133 declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>)
135 declare <vscale x 1 x i64> @llvm.riscv.vadd.nxv1i64.nxv1i64.i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i64>, i64) #1
137 declare <vscale x 1 x i64> @llvm.riscv.vsub.nxv1i64.nxv1i64.i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i64>, i64) #1
139 declare <vscale x 1 x i64> @llvm.riscv.vle.nxv1i64.i64(<vscale x 1 x i64>, <vscale x 1 x i64>* nocapture, i64) #3
141 declare <vscale x 1 x i32> @llvm.riscv.vle.nxv1i32.i64(<vscale x 1 x i32>, <vscale x 1 x i32>* nocapture, i64) #3
143 declare void @llvm.riscv.vse.nxv1i64.i64(<vscale x 1 x i64>, <vscale x 1 x i64>* nocapture, i64) #4
145 declare <vscale x 1 x i64> @llvm.riscv.vzext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64>, <vscale x 1 x i32>, i64) #1
147 declare <vscale x 1 x i64> @llvm.riscv.vsext.nxv1i64.nxv1i32.i64(<vscale x 1 x i64>, <vscale x 1 x i32>, i64) #1
149 attributes #0 = { "target-features"="+v" }
150 attributes #1 = { nounwind readnone }
151 attributes #2 = { nounwind }
152 attributes #3 = { nounwind readonly }
153 attributes #4 = { nounwind writeonly }
157 name: load_add_or_sub
159 tracksRegLiveness: true
161 - { id: 0, class: vr }
162 - { id: 1, class: vr }
163 - { id: 2, class: vr }
164 - { id: 3, class: vr }
165 - { id: 4, class: gpr }
166 - { id: 5, class: gpr }
167 - { id: 6, class: vr }
168 - { id: 7, class: gprnox0 }
169 - { id: 8, class: gpr }
171 - { reg: '$x10', virtual-reg: '%4' }
172 - { reg: '$x11', virtual-reg: '%5' }
173 - { reg: '$v8', virtual-reg: '%6' }
174 - { reg: '$x12', virtual-reg: '%7' }
177 machineFunctionInfo: {}
179 ; CHECK-LABEL: name: load_add_or_sub
181 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
182 ; CHECK-NEXT: liveins: $x10, $x11, $v8, $x12
184 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x12
185 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v8
186 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x11
187 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x10
188 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
189 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
190 ; CHECK-NEXT: [[PseudoVLE64_V_M1_:%[0-9]+]]:vr = PseudoVLE64_V_M1 %pt, [[COPY2]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
191 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
192 ; CHECK-NEXT: BEQ [[COPY3]], [[COPY4]], %bb.2
193 ; CHECK-NEXT: PseudoBR %bb.1
195 ; CHECK-NEXT: bb.1.if.then:
196 ; CHECK-NEXT: successors: %bb.3(0x80000000)
198 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
199 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 %pt2, [[PseudoVLE64_V_M1_]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
200 ; CHECK-NEXT: PseudoBR %bb.3
202 ; CHECK-NEXT: bb.2.if.else:
203 ; CHECK-NEXT: successors: %bb.3(0x80000000)
205 ; CHECK-NEXT: %pt3:vr = IMPLICIT_DEF
206 ; CHECK-NEXT: [[PseudoVSUB_VV_M1_:%[0-9]+]]:vr = PseudoVSUB_VV_M1 %pt3, [[PseudoVLE64_V_M1_]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
208 ; CHECK-NEXT: bb.3.if.end:
209 ; CHECK-NEXT: [[PHI:%[0-9]+]]:vr = PHI [[PseudoVADD_VV_M1_]], %bb.1, [[PseudoVSUB_VV_M1_]], %bb.2
210 ; CHECK-NEXT: $v8 = COPY [[PHI]]
211 ; CHECK-NEXT: PseudoRET implicit $v8
213 successors: %bb.2(0x30000000), %bb.1(0x50000000)
214 liveins: $x10, $x11, $v8, $x12
216 %7:gprnox0 = COPY $x12
220 %pt:vr = IMPLICIT_DEF
221 %0:vr = PseudoVLE64_V_M1 %pt, %5, %7, 6, 0
227 %pt2:vr = IMPLICIT_DEF
228 %1:vr = PseudoVADD_VV_M1 %pt2, %0, %6, %7, 6, 0
232 %pt3:vr = IMPLICIT_DEF
233 %2:vr = PseudoVSUB_VV_M1 %pt3, %0, %6, %7, 6, 0
236 %3:vr = PHI %1, %bb.1, %2, %bb.2
238 PseudoRET implicit $v8
242 name: load_zext_or_sext
244 tracksRegLiveness: true
246 - { id: 0, class: vr }
247 - { id: 1, class: vr }
248 - { id: 2, class: vr }
249 - { id: 3, class: vr }
250 - { id: 4, class: gpr }
251 - { id: 5, class: gpr }
252 - { id: 6, class: gpr }
253 - { id: 7, class: gprnox0 }
254 - { id: 8, class: gpr }
256 - { reg: '$x10', virtual-reg: '%4' }
257 - { reg: '$x11', virtual-reg: '%5' }
258 - { reg: '$x12', virtual-reg: '%6' }
259 - { reg: '$x13', virtual-reg: '%7' }
262 machineFunctionInfo: {}
264 ; CHECK-LABEL: name: load_zext_or_sext
266 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
267 ; CHECK-NEXT: liveins: $x10, $x11, $x12, $x13
269 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x13
270 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x12
271 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x11
272 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x10
273 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
274 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 215 /* e32, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype
275 ; CHECK-NEXT: [[PseudoVLE32_V_MF2_:%[0-9]+]]:vr = PseudoVLE32_V_MF2 %pt, [[COPY2]], $noreg, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
276 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
277 ; CHECK-NEXT: BEQ [[COPY3]], [[COPY4]], %bb.2
278 ; CHECK-NEXT: PseudoBR %bb.1
280 ; CHECK-NEXT: bb.1.if.then:
281 ; CHECK-NEXT: successors: %bb.3(0x80000000)
283 ; CHECK-NEXT: %dead1:vr = IMPLICIT_DEF
284 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
285 ; CHECK-NEXT: early-clobber %1:vr = PseudoVZEXT_VF2_M1 %dead1, [[PseudoVLE32_V_MF2_]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
286 ; CHECK-NEXT: PseudoBR %bb.3
288 ; CHECK-NEXT: bb.2.if.else:
289 ; CHECK-NEXT: successors: %bb.3(0x80000000)
291 ; CHECK-NEXT: %dead2:vr = IMPLICIT_DEF
292 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
293 ; CHECK-NEXT: early-clobber %2:vr = PseudoVSEXT_VF2_M1 %dead2, [[PseudoVLE32_V_MF2_]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
295 ; CHECK-NEXT: bb.3.if.end:
296 ; CHECK-NEXT: [[PHI:%[0-9]+]]:vr = PHI %1, %bb.1, %2, %bb.2
297 ; CHECK-NEXT: PseudoVSE64_V_M1 [[PHI]], [[COPY1]], $noreg, 6 /* e64 */, implicit $vl, implicit $vtype
298 ; CHECK-NEXT: PseudoRET
300 successors: %bb.2(0x30000000), %bb.1(0x50000000)
301 liveins: $x10, $x11, $x12, $x13
303 %7:gprnox0 = COPY $x13
307 %pt:vr = IMPLICIT_DEF
308 %0:vr = PseudoVLE32_V_MF2 %pt, %5, %7, 5, 0
314 %dead1:vr = IMPLICIT_DEF
315 early-clobber %1:vr = PseudoVZEXT_VF2_M1 %dead1, %0, %7, 6, 0
319 %dead2:vr = IMPLICIT_DEF
320 early-clobber %2:vr = PseudoVSEXT_VF2_M1 %dead2, %0, %7, 6, 0
323 %3:vr = PHI %1, %bb.1, %2, %bb.2
324 PseudoVSE64_V_M1 %3, %6, %7, 6
331 tracksRegLiveness: true
333 - { id: 0, class: vr }
334 - { id: 1, class: vr }
335 - { id: 2, class: vr }
336 - { id: 3, class: gpr }
337 - { id: 4, class: vr }
338 - { id: 5, class: vr }
339 - { id: 6, class: gprnox0 }
340 - { id: 7, class: gpr }
341 - { id: 8, class: gpr }
343 - { reg: '$x10', virtual-reg: '%3' }
344 - { reg: '$v8', virtual-reg: '%4' }
345 - { reg: '$v9', virtual-reg: '%5' }
346 - { reg: '$x11', virtual-reg: '%6' }
349 machineFunctionInfo: {}
351 ; CHECK-LABEL: name: vmv_x_s
353 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
354 ; CHECK-NEXT: liveins: $x10, $v8, $v9, $x11
356 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
357 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v9
358 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
359 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x10
360 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
361 ; CHECK-NEXT: BEQ [[COPY3]], [[COPY4]], %bb.2
362 ; CHECK-NEXT: PseudoBR %bb.1
364 ; CHECK-NEXT: bb.1.if.then:
365 ; CHECK-NEXT: successors: %bb.3(0x80000000)
367 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
368 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
369 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 %pt, [[COPY2]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
370 ; CHECK-NEXT: PseudoBR %bb.3
372 ; CHECK-NEXT: bb.2.if.else:
373 ; CHECK-NEXT: successors: %bb.3(0x80000000)
375 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
376 ; CHECK-NEXT: dead $x0 = PseudoVSETVLI [[COPY]], 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
377 ; CHECK-NEXT: [[PseudoVSUB_VV_M1_:%[0-9]+]]:vr = PseudoVSUB_VV_M1 %pt2, [[COPY1]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
379 ; CHECK-NEXT: bb.3.if.end:
380 ; CHECK-NEXT: [[PHI:%[0-9]+]]:vr = PHI [[PseudoVADD_VV_M1_]], %bb.1, [[PseudoVSUB_VV_M1_]], %bb.2
381 ; CHECK-NEXT: [[PseudoVMV_X_S_M1_:%[0-9]+]]:gpr = PseudoVMV_X_S_M1 [[PHI]], 6 /* e64 */, implicit $vtype
382 ; CHECK-NEXT: $x10 = COPY [[PseudoVMV_X_S_M1_]]
383 ; CHECK-NEXT: PseudoRET implicit $x10
385 successors: %bb.2(0x30000000), %bb.1(0x50000000)
386 liveins: $x10, $v8, $v9, $x11
388 %6:gprnox0 = COPY $x11
397 %pt:vr = IMPLICIT_DEF
398 %0:vr = PseudoVADD_VV_M1 %pt, %4, %5, %6, 6, 0
402 %pt2:vr = IMPLICIT_DEF
403 %1:vr = PseudoVSUB_VV_M1 %pt2, %5, %5, %6, 6, 0
406 %2:vr = PHI %0, %bb.1, %1, %bb.2
407 %8:gpr = PseudoVMV_X_S_M1 %2, 6
409 PseudoRET implicit $x10
413 name: vsetvli_add_or_sub
415 tracksRegLiveness: true
417 - { id: 0, class: gprnox0 }
418 - { id: 1, class: vr }
419 - { id: 2, class: vr }
420 - { id: 3, class: vr }
421 - { id: 4, class: gpr }
422 - { id: 5, class: vr }
423 - { id: 6, class: vr }
424 - { id: 7, class: gprnox0 }
425 - { id: 8, class: gpr }
427 - { reg: '$x10', virtual-reg: '%4' }
428 - { reg: '$v8', virtual-reg: '%5' }
429 - { reg: '$v9', virtual-reg: '%6' }
430 - { reg: '$x11', virtual-reg: '%7' }
433 machineFunctionInfo: {}
435 ; CHECK-LABEL: name: vsetvli_add_or_sub
437 ; CHECK-NEXT: successors: %bb.2(0x30000000), %bb.1(0x50000000)
438 ; CHECK-NEXT: liveins: $x10, $v8, $v9, $x11
440 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprnox0 = COPY $x11
441 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr = COPY $v9
442 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY $v8
443 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x10
444 ; CHECK-NEXT: [[PseudoVSETVLI:%[0-9]+]]:gprnox0 = PseudoVSETVLI [[COPY]], 88 /* e64, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
445 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
446 ; CHECK-NEXT: BEQ [[COPY3]], [[COPY4]], %bb.2
447 ; CHECK-NEXT: PseudoBR %bb.1
449 ; CHECK-NEXT: bb.1.if.then:
450 ; CHECK-NEXT: successors: %bb.3(0x80000000)
452 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
453 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 %pt, [[COPY2]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
454 ; CHECK-NEXT: PseudoBR %bb.3
456 ; CHECK-NEXT: bb.2.if.else:
457 ; CHECK-NEXT: successors: %bb.3(0x80000000)
459 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
460 ; CHECK-NEXT: [[PseudoVSUB_VV_M1_:%[0-9]+]]:vr = PseudoVSUB_VV_M1 %pt2, [[COPY2]], [[COPY1]], $noreg, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
462 ; CHECK-NEXT: bb.3.if.end:
463 ; CHECK-NEXT: [[PHI:%[0-9]+]]:vr = PHI [[PseudoVADD_VV_M1_]], %bb.1, [[PseudoVSUB_VV_M1_]], %bb.2
464 ; CHECK-NEXT: $v8 = COPY [[PHI]]
465 ; CHECK-NEXT: PseudoRET implicit $v8
467 successors: %bb.2(0x30000000), %bb.1(0x50000000)
468 liveins: $x10, $v8, $v9, $x11
470 %7:gprnox0 = COPY $x11
474 %0:gprnox0 = PseudoVSETVLI %7, 88, implicit-def dead $vl, implicit-def dead $vtype
480 %pt:vr = IMPLICIT_DEF
481 %1:vr = PseudoVADD_VV_M1 %pt, %5, %6, %0, 6, 0
485 %pt2:vr = IMPLICIT_DEF
486 %2:vr = PseudoVSUB_VV_M1 %pt2, %5, %6, %0, 6, 0
489 %3:vr = PHI %1, %bb.1, %2, %bb.2
491 PseudoRET implicit $v8
496 tracksRegLiveness: true
498 - { id: 0, class: gpr, preferred-register: '' }
499 - { id: 1, class: gpr, preferred-register: '' }
500 - { id: 2, class: gpr, preferred-register: '' }
501 - { id: 3, class: vr, preferred-register: '' }
502 - { id: 4, class: vrnov0, preferred-register: '' }
503 - { id: 5, class: vmv0, preferred-register: '' }
504 - { id: 6, class: vrnov0, preferred-register: '' }
505 - { id: 7, class: gpr, preferred-register: '' }
506 - { id: 8, class: gpr, preferred-register: '' }
507 - { id: 9, class: gpr, preferred-register: '' }
508 - { id: 10, class: gpr, preferred-register: '' }
509 - { id: 11, class: vr, preferred-register: '' }
511 ; CHECK-LABEL: name: vsetvli_vcpop
513 ; CHECK-NEXT: successors: %bb.1(0x80000000)
514 ; CHECK-NEXT: liveins: $x10, $x11
516 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x11
517 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
518 ; CHECK-NEXT: [[DEF:%[0-9]+]]:gpr = IMPLICIT_DEF
519 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
520 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 223 /* e64, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype
521 ; CHECK-NEXT: [[PseudoVID_V_MF2_:%[0-9]+]]:vr = PseudoVID_V_MF2 %pt, -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
522 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
523 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_1:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 215 /* e32, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype
524 ; CHECK-NEXT: [[PseudoVMV_V_I_MF2_:%[0-9]+]]:vrnov0 = PseudoVMV_V_I_MF2 %pt2, 0, -1, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
527 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
529 ; CHECK-NEXT: [[PseudoVMSEQ_VI_MF2_:%[0-9]+]]:vmv0 = PseudoVMSEQ_VI_MF2 killed [[PseudoVID_V_MF2_]], 0, -1, 5 /* e32 */, implicit $vl, implicit $vtype
530 ; CHECK-NEXT: $v0 = COPY [[PseudoVMSEQ_VI_MF2_]]
531 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 23 /* e32, mf2, tu, mu */, implicit-def $vl, implicit-def $vtype, implicit $vl
532 ; CHECK-NEXT: [[PseudoVLE32_V_MF2_MASK:%[0-9]+]]:vrnov0 = PseudoVLE32_V_MF2_MASK [[PseudoVMV_V_I_MF2_]], killed [[COPY]], $v0, -1, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
533 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 197 /* e8, mf8, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
534 ; CHECK-NEXT: [[PseudoVCPOP_M_B1_:%[0-9]+]]:gpr = PseudoVCPOP_M_B1 [[PseudoVMSEQ_VI_MF2_]], -1, 0 /* e8 */, implicit $vl, implicit $vtype
535 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
536 ; CHECK-NEXT: BEQ killed [[PseudoVCPOP_M_B1_]], [[COPY2]], %bb.3
537 ; CHECK-NEXT: PseudoBR %bb.2
540 ; CHECK-NEXT: successors: %bb.3(0x80000000)
542 ; CHECK-NEXT: [[LWU:%[0-9]+]]:gpr = LWU [[COPY1]], 0
545 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[DEF]], %bb.1, [[LWU]], %bb.2
546 ; CHECK-NEXT: %pt3:vr = IMPLICIT_DEF
547 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 215 /* e32, mf2, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
548 ; CHECK-NEXT: [[PseudoVADD_VX_MF2_:%[0-9]+]]:vr = nsw PseudoVADD_VX_MF2 %pt3, [[PseudoVLE32_V_MF2_MASK]], [[PHI]], -1, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
549 ; CHECK-NEXT: $v0 = COPY [[PseudoVADD_VX_MF2_]]
550 ; CHECK-NEXT: PseudoRET implicit $v0
552 successors: %bb.1(0x80000000)
557 %2:gpr = IMPLICIT_DEF
558 %pt:vr = IMPLICIT_DEF
559 %3:vr = PseudoVID_V_MF2 %pt, -1, 6, 0
560 %pt2:vr = IMPLICIT_DEF
561 %4:vrnov0 = PseudoVMV_V_I_MF2 %pt2, 0, -1, 5, 0
564 successors: %bb.2(0x40000000), %bb.3(0x40000000)
566 %5:vmv0 = PseudoVMSEQ_VI_MF2 killed %3, 0, -1, 5
568 %6:vrnov0 = PseudoVLE32_V_MF2_MASK %4, killed %0, $v0, -1, 5, 0
569 %7:gpr = PseudoVCPOP_M_B1 %5, -1, 0
571 BEQ killed %7, %8, %bb.3
575 successors: %bb.3(0x80000000)
580 %10:gpr = PHI %2, %bb.1, %9, %bb.2
581 %pt3:vr = IMPLICIT_DEF
582 %11:vr = nsw PseudoVADD_VX_MF2 %pt3, %6, %10, -1, 5, 0
584 PseudoRET implicit $v0
587 name: vsetvli_loop_store
588 tracksRegLiveness: true
590 - { id: 0, class: gpr, preferred-register: '' }
591 - { id: 1, class: gpr, preferred-register: '' }
592 - { id: 2, class: gpr, preferred-register: '' }
593 - { id: 3, class: gpr, preferred-register: '' }
594 - { id: 4, class: vr, preferred-register: '' }
595 - { id: 5, class: gpr, preferred-register: '' }
596 - { id: 6, class: gpr, preferred-register: '' }
597 - { id: 7, class: vr, preferred-register: '' }
598 - { id: 8, class: gpr, preferred-register: '' }
599 - { id: 9, class: gpr, preferred-register: '' }
600 - { id: 10, class: gpr, preferred-register: '' }
602 ; CHECK-LABEL: name: vsetvli_loop_store
604 ; CHECK-NEXT: successors: %bb.1(0x80000000)
605 ; CHECK-NEXT: liveins: $x10, $x11
607 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
608 ; CHECK-NEXT: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
609 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
610 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
611 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
612 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
613 ; CHECK-NEXT: [[PseudoVID_V_M1_:%[0-9]+]]:vr = PseudoVID_V_M1 %pt, -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
614 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
617 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
619 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY2]], %bb.0, %10, %bb.1
620 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
621 ; CHECK-NEXT: [[PseudoVADD_VX_M1_:%[0-9]+]]:vr = PseudoVADD_VX_M1 %pt2, [[PseudoVID_V_M1_]], [[PHI]], -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
622 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[PHI]], [[SRLI]]
623 ; CHECK-NEXT: [[ADD:%[0-9]+]]:gpr = ADD [[COPY]], [[MUL]]
624 ; CHECK-NEXT: PseudoVSE32_V_MF2 killed [[PseudoVADD_VX_M1_]], killed [[ADD]], -1, 5 /* e32 */, implicit $vl, implicit $vtype
625 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[PHI]], 1
626 ; CHECK-NEXT: BLTU [[ADDI]], [[COPY1]], %bb.1
627 ; CHECK-NEXT: PseudoBR %bb.2
630 ; CHECK-NEXT: PseudoRET
634 %1:gpr = PseudoReadVLENB
635 %2:gpr = SRLI %1:gpr, 3
637 %pt:vr = IMPLICIT_DEF
638 %4:vr = PseudoVID_V_M1 %pt, -1, 6, 0
642 successors: %bb.1, %bb.2
644 %6:gpr = PHI %5:gpr, %bb.0, %10:gpr, %bb.1
645 %pt2:vr = IMPLICIT_DEF
646 %7:vr = PseudoVADD_VX_M1 %pt2, %4:vr, %6:gpr, -1, 6, 0
647 %8:gpr = MUL %6:gpr, %2:gpr
648 %9:gpr = ADD %0:gpr, %8:gpr
649 PseudoVSE32_V_MF2 killed %7:vr, killed %9:gpr, -1, 5
650 %10:gpr = ADDI %6:gpr, 1
651 BLTU %10:gpr, %3:gpr, %bb.1
659 name: vsetvli_loop_store2
660 tracksRegLiveness: true
662 - { id: 0, class: gpr, preferred-register: '' }
663 - { id: 1, class: gpr, preferred-register: '' }
664 - { id: 2, class: gpr, preferred-register: '' }
665 - { id: 3, class: gpr, preferred-register: '' }
666 - { id: 4, class: vr, preferred-register: '' }
667 - { id: 5, class: gpr, preferred-register: '' }
668 - { id: 6, class: gpr, preferred-register: '' }
669 - { id: 7, class: vr, preferred-register: '' }
670 - { id: 8, class: gpr, preferred-register: '' }
671 - { id: 9, class: gpr, preferred-register: '' }
672 - { id: 10, class: gpr, preferred-register: '' }
674 ; CHECK-LABEL: name: vsetvli_loop_store2
676 ; CHECK-NEXT: successors: %bb.1(0x80000000)
677 ; CHECK-NEXT: liveins: $x10, $x11
679 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
680 ; CHECK-NEXT: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
681 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
682 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
683 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
684 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
685 ; CHECK-NEXT: [[PseudoVID_V_M1_:%[0-9]+]]:vr = PseudoVID_V_M1 %pt, -1, 6 /* e64 */, 3 /* ta, ma */, implicit $vl, implicit $vtype
686 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
689 ; CHECK-NEXT: successors: %bb.2(0x80000000)
691 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY2]], %bb.0, %10, %bb.2
692 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
693 ; CHECK-NEXT: [[PseudoVADD_VX_M1_:%[0-9]+]]:vr = PseudoVADD_VX_M1 %pt2, [[PseudoVID_V_M1_]], [[PHI]], -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
694 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[PHI]], [[SRLI]]
695 ; CHECK-NEXT: [[ADD:%[0-9]+]]:gpr = ADD [[COPY]], [[MUL]]
696 ; CHECK-NEXT: PseudoVSE32_V_MF2 killed [[PseudoVADD_VX_M1_]], killed [[ADD]], -1, 5 /* e32 */, implicit $vl, implicit $vtype
697 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[PHI]], 1
700 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.3(0x40000000)
702 ; CHECK-NEXT: BLTU [[ADDI]], [[COPY1]], %bb.1
703 ; CHECK-NEXT: PseudoBR %bb.3
706 ; CHECK-NEXT: PseudoRET
710 %1:gpr = PseudoReadVLENB
711 %2:gpr = SRLI %1:gpr, 3
713 %pt:vr = IMPLICIT_DEF
714 %4:vr = PseudoVID_V_M1 %pt, -1, 6, 3
720 %6:gpr = PHI %5:gpr, %bb.0, %10:gpr, %bb.3
721 %pt2:vr = IMPLICIT_DEF
722 %7:vr = PseudoVADD_VX_M1 %pt2, %4:vr, %6:gpr, -1, 6, 0
723 %8:gpr = MUL %6:gpr, %2:gpr
724 %9:gpr = ADD %0:gpr, %8:gpr
725 PseudoVSE32_V_MF2 killed %7:vr, killed %9:gpr, -1, 5
726 %10:gpr = ADDI %6:gpr, 1
729 successors: %bb.1, %bb.2
730 BLTU %10:gpr, %3:gpr, %bb.1
740 tracksRegLiveness: true
742 - { id: 0, class: gpr }
743 - { id: 1, class: gpr }
744 - { id: 2, class: vr }
745 - { id: 3, class: vr }
746 - { id: 4, class: gpr }
747 - { id: 5, class: gpr }
748 - { id: 6, class: gpr }
749 - { id: 7, class: gpr }
750 - { id: 8, class: gpr }
751 - { id: 9, class: gpr }
752 - { id: 10, class: vr }
753 - { id: 11, class: vr }
754 - { id: 12, class: vr }
755 - { id: 13, class: gpr }
756 - { id: 14, class: vr }
757 - { id: 15, class: vr }
758 - { id: 16, class: vr }
759 - { id: 17, class: vr }
760 - { id: 18, class: gpr }
761 - { id: 19, class: gpr }
762 - { id: 20, class: vr }
763 - { id: 21, class: vr }
764 - { id: 22, class: vr }
765 - { id: 23, class: vr }
766 - { id: 24, class: vr }
768 - { reg: '$x10', virtual-reg: '%6' }
769 - { reg: '$x12', virtual-reg: '%8' }
772 machineFunctionInfo: {}
774 ; CHECK-LABEL: name: redusum_loop
776 ; CHECK-NEXT: successors: %bb.1(0x80000000)
777 ; CHECK-NEXT: liveins: $x10, $x12
779 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x12
780 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x10
781 ; CHECK-NEXT: %dead:vr = IMPLICIT_DEF
782 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 4, 208 /* e32, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
783 ; CHECK-NEXT: [[PseudoVMV_V_I_M1_:%[0-9]+]]:vr = PseudoVMV_V_I_M1 %dead, 0, 4, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
784 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vr = COPY [[PseudoVMV_V_I_M1_]]
785 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vr = COPY [[COPY2]]
786 ; CHECK-NEXT: [[LUI:%[0-9]+]]:gpr = LUI 1
787 ; CHECK-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW killed [[LUI]], -2048
789 ; CHECK-NEXT: bb.1.vector.body:
790 ; CHECK-NEXT: successors: %bb.2(0x04000000), %bb.1(0x7c000000)
792 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY1]], %bb.0, %5, %bb.1
793 ; CHECK-NEXT: [[PHI1:%[0-9]+]]:gpr = PHI [[ADDIW]], %bb.0, %4, %bb.1
794 ; CHECK-NEXT: [[PHI2:%[0-9]+]]:vr = PHI [[COPY3]], %bb.0, %16, %bb.1
795 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
796 ; CHECK-NEXT: [[PseudoVLE32_V_M1_:%[0-9]+]]:vr = PseudoVLE32_V_M1 %pt, [[PHI]], 4, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype :: (load (s128) from %ir.lsr.iv12, align 4)
797 ; CHECK-NEXT: %pt2:vr = IMPLICIT_DEF
798 ; CHECK-NEXT: [[PseudoVADD_VV_M1_:%[0-9]+]]:vr = PseudoVADD_VV_M1 %pt2, killed [[PseudoVLE32_V_M1_]], [[PHI2]], 4, 5 /* e32 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
799 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = nsw ADDI [[PHI1]], -4
800 ; CHECK-NEXT: [[ADDI1:%[0-9]+]]:gpr = ADDI [[PHI]], 16
801 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
802 ; CHECK-NEXT: BNE [[ADDI]], [[COPY4]], %bb.1
803 ; CHECK-NEXT: PseudoBR %bb.2
805 ; CHECK-NEXT: bb.2.middle.block:
806 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:gpr = COPY $x0
807 ; CHECK-NEXT: [[DEF:%[0-9]+]]:vr = IMPLICIT_DEF
808 ; CHECK-NEXT: [[PseudoVMV_S_X_M1_:%[0-9]+]]:vr = PseudoVMV_S_X_M1 [[DEF]], [[COPY5]], 1, 5 /* e32 */, implicit $vl, implicit $vtype
809 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:vr = IMPLICIT_DEF
810 ; CHECK-NEXT: [[PseudoVREDSUM_VS_M1_E8_:%[0-9]+]]:vr = PseudoVREDSUM_VS_M1_E8 [[DEF1]], [[PseudoVADD_VV_M1_]], killed [[PseudoVMV_S_X_M1_]], 4, 5 /* e32 */, 1 /* ta, mu */, implicit $vl, implicit $vtype
811 ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 1, 208 /* e32, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
812 ; CHECK-NEXT: PseudoVSE32_V_M1 killed [[PseudoVREDSUM_VS_M1_E8_]], [[COPY]], 1, 5 /* e32 */, implicit $vl, implicit $vtype :: (store (s32) into %ir.res)
813 ; CHECK-NEXT: PseudoRET
819 %dead:vr = IMPLICIT_DEF
820 %11:vr = PseudoVMV_V_I_M1 %dead, 0, 4, 5, 0
824 %9:gpr = ADDIW killed %13, -2048
827 successors: %bb.2(0x04000000), %bb.1(0x7c000000)
829 %0:gpr = PHI %6, %bb.0, %5, %bb.1
830 %1:gpr = PHI %9, %bb.0, %4, %bb.1
831 %2:vr = PHI %10, %bb.0, %16, %bb.1
832 %pt:vr = IMPLICIT_DEF
833 %14:vr = PseudoVLE32_V_M1 %pt, %0, 4, 5, 0 :: (load (s128) from %ir.lsr.iv12, align 4)
834 %pt2:vr = IMPLICIT_DEF
835 %16:vr = PseudoVADD_VV_M1 %pt2, killed %14, %2, 4, 5, 0
836 %4:gpr = nsw ADDI %1, -4
844 %21:vr = IMPLICIT_DEF
845 %20:vr = PseudoVMV_S_X_M1 %21, %19, 1, 5
846 %24:vr = IMPLICIT_DEF
847 %23:vr = PseudoVREDSUM_VS_M1_E8 %24, %16, killed %20, 4, 5, 1
848 PseudoVSE32_V_M1 killed %23, %8, 1, 5 :: (store (s32) into %ir.res)
853 name: vsetvli_vluxei64_regression
854 tracksRegLiveness: true
856 ; CHECK-LABEL: name: vsetvli_vluxei64_regression
858 ; CHECK-NEXT: successors: %bb.1(0x80000000)
859 ; CHECK-NEXT: liveins: $x10, $x11, $x12, $v0, $v1, $v2, $v3
861 ; CHECK-NEXT: %a:gpr = COPY $x10
862 ; CHECK-NEXT: %b:gpr = COPY $x11
863 ; CHECK-NEXT: %inaddr:gpr = COPY $x12
864 ; CHECK-NEXT: %idxs:vr = COPY $v0
865 ; CHECK-NEXT: %t1:vr = COPY $v1
866 ; CHECK-NEXT: %t3:vr = COPY $v2
867 ; CHECK-NEXT: %t4:vr = COPY $v3
868 ; CHECK-NEXT: %t5:vrnov0 = COPY $v1
869 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
870 ; CHECK-NEXT: %t6:vr = PseudoVMSEQ_VI_M1 %t1, 0, -1, 6 /* e64 */, implicit $vl, implicit $vtype
871 ; CHECK-NEXT: PseudoBR %bb.1
874 ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.2(0x40000000)
876 ; CHECK-NEXT: %mask:vr = PseudoVMANDN_MM_MF8 %t6, %t3, -1, 0 /* e8 */, implicit $vl, implicit $vtype
877 ; CHECK-NEXT: %t2:gpr = COPY $x0
878 ; CHECK-NEXT: BEQ %a, %t2, %bb.3
879 ; CHECK-NEXT: PseudoBR %bb.2
882 ; CHECK-NEXT: successors: %bb.3(0x80000000)
884 ; CHECK-NEXT: $v0 = COPY %mask
885 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 69 /* e8, mf8, ta, mu */, implicit-def $vl, implicit-def $vtype, implicit $vl
886 ; CHECK-NEXT: early-clobber %t0:vrnov0 = PseudoVLUXEI64_V_M1_MF8_MASK %t5, killed %inaddr, %idxs, $v0, -1, 3 /* e8 */, 1 /* ta, mu */, implicit $vl, implicit $vtype
887 ; CHECK-NEXT: %ldval:vr = COPY %t0
888 ; CHECK-NEXT: PseudoBR %bb.3
891 ; CHECK-NEXT: %stval:vr = PHI %t4, %bb.1, %ldval, %bb.2
892 ; CHECK-NEXT: $v0 = COPY %mask
893 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 197 /* e8, mf8, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
894 ; CHECK-NEXT: PseudoVSOXEI64_V_M1_MF8_MASK killed %stval, killed %b, %idxs, $v0, -1, 3 /* e8 */, implicit $vl, implicit $vtype
895 ; CHECK-NEXT: PseudoRET
898 liveins: $x10, $x11, $x12, $v0, $v1, $v2, $v3
902 %inaddr:gpr = COPY $x12
907 %t5:vrnov0 = COPY $v1
908 %t6:vr = PseudoVMSEQ_VI_M1 %t1, 0, -1, 6
912 successors: %bb.3, %bb.2
914 %mask:vr = PseudoVMANDN_MM_MF8 %t6, %t3, -1, 0
923 early-clobber %t0:vrnov0 = PseudoVLUXEI64_V_M1_MF8_MASK %t5, killed %inaddr, %idxs, $v0, -1, 3, 1
928 %stval:vr = PHI %t4, %bb.1, %ldval, %bb.2
930 PseudoVSOXEI64_V_M1_MF8_MASK killed %stval, killed %b, %idxs, $v0, -1, 3
936 tracksRegLiveness: true
938 ; CHECK-LABEL: name: if_in_loop
940 ; CHECK-NEXT: successors: %bb.1(0x80000000)
941 ; CHECK-NEXT: liveins: $x10, $x11, $x12, $x13, $x14, $x15
943 ; CHECK-NEXT: %dst:gpr = COPY $x10
944 ; CHECK-NEXT: %src:gpr = COPY $x11
945 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x12
946 ; CHECK-NEXT: %tc:gpr = COPY $x13
947 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x14
948 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x15
949 ; CHECK-NEXT: %vlenb:gpr = PseudoReadVLENB
950 ; CHECK-NEXT: %inc:gpr = SRLI killed %vlenb, 3
951 ; CHECK-NEXT: %pt:vr = IMPLICIT_DEF
952 ; CHECK-NEXT: dead [[PseudoVSETVLIX0_:%[0-9]+]]:gpr = PseudoVSETVLIX0 $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype
953 ; CHECK-NEXT: [[PseudoVID_V_M1_:%[0-9]+]]:vr = PseudoVID_V_M1 %pt, -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
954 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x0
955 ; CHECK-NEXT: PseudoBR %bb.1
958 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
960 ; CHECK-NEXT: [[PHI:%[0-9]+]]:gpr = PHI [[COPY3]], %bb.0, %12, %bb.3
961 ; CHECK-NEXT: [[ADD:%[0-9]+]]:gpr = ADD [[COPY2]], [[PHI]]
962 ; CHECK-NEXT: %pta:vr = IMPLICIT_DEF
963 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 216 /* e64, m1, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
964 ; CHECK-NEXT: [[PseudoVADD_VX_M1_:%[0-9]+]]:vr = PseudoVADD_VX_M1 %pta, [[PseudoVID_V_M1_]], killed [[ADD]], -1, 6 /* e64 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
965 ; CHECK-NEXT: [[PseudoVMSLTU_VX_M1_:%[0-9]+]]:vr = PseudoVMSLTU_VX_M1 [[PseudoVADD_VX_M1_]], [[COPY1]], -1, 6 /* e64 */, implicit $vl, implicit $vtype
966 ; CHECK-NEXT: [[PseudoVCPOP_M_B1_:%[0-9]+]]:gpr = PseudoVCPOP_M_B1 [[PseudoVMSLTU_VX_M1_]], -1, 0 /* e8 */, implicit $vl, implicit $vtype
967 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr = COPY $x0
968 ; CHECK-NEXT: BEQ killed [[PseudoVCPOP_M_B1_]], [[COPY4]], %bb.3
969 ; CHECK-NEXT: PseudoBR %bb.2
972 ; CHECK-NEXT: successors: %bb.3(0x80000000)
974 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:gpr = ADD %src, [[PHI]]
975 ; CHECK-NEXT: %pt2:vrnov0 = IMPLICIT_DEF
976 ; CHECK-NEXT: [[PseudoVLE8_V_MF8_:%[0-9]+]]:vrnov0 = PseudoVLE8_V_MF8 %pt2, killed [[ADD1]], -1, 3 /* e8 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
977 ; CHECK-NEXT: %ptb:vr = IMPLICIT_DEF
978 ; CHECK-NEXT: dead $x0 = PseudoVSETVLIX0 killed $x0, 197 /* e8, mf8, ta, ma */, implicit-def $vl, implicit-def $vtype, implicit $vl
979 ; CHECK-NEXT: [[PseudoVADD_VI_MF8_:%[0-9]+]]:vrnov0 = PseudoVADD_VI_MF8 %ptb, [[PseudoVLE8_V_MF8_]], 4, -1, 3 /* e8 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
980 ; CHECK-NEXT: [[ADD2:%[0-9]+]]:gpr = ADD %dst, [[PHI]]
981 ; CHECK-NEXT: PseudoVSE8_V_MF8 killed [[PseudoVADD_VI_MF8_]], killed [[ADD2]], -1, 3 /* e8 */, implicit $vl, implicit $vtype
984 ; CHECK-NEXT: successors: %bb.1(0x7c000000), %bb.4(0x04000000)
986 ; CHECK-NEXT: [[ADD3:%[0-9]+]]:gpr = ADD [[PHI]], %inc
987 ; CHECK-NEXT: BLTU [[ADD3]], %tc, %bb.1
988 ; CHECK-NEXT: PseudoBR %bb.4
991 ; CHECK-NEXT: PseudoRET
993 successors: %bb.1(0x80000000)
994 liveins: $x10, $x11, $x12, $x13, $x14, $x15
1002 %vlenb:gpr = PseudoReadVLENB
1003 %inc:gpr = SRLI killed %vlenb, 3
1004 %pt:vr = IMPLICIT_DEF
1005 %10:vr = PseudoVID_V_M1 %pt, -1, 6, 0
1010 successors: %bb.2(0x40000000), %bb.3(0x40000000)
1012 %26:gpr = PHI %59, %bb.0, %28, %bb.3
1013 %61:gpr = ADD %12, %26
1014 %pta:vr = IMPLICIT_DEF
1015 %27:vr = PseudoVADD_VX_M1 %pta, %10, killed %61, -1, 6, 0
1016 %62:vr = PseudoVMSLTU_VX_M1 %27, %11, -1, 6
1017 %63:gpr = PseudoVCPOP_M_B1 %62, -1, 0
1019 BEQ killed %63, %64, %bb.3
1023 successors: %bb.3(0x80000000)
1025 %66:gpr = ADD %src, %26
1026 %pt2:vrnov0 = IMPLICIT_DEF
1027 %67:vrnov0 = PseudoVLE8_V_MF8 %pt2, killed %66, -1, 3, 0
1028 %ptb:vr = IMPLICIT_DEF
1029 %76:vrnov0 = PseudoVADD_VI_MF8 %ptb, %67, 4, -1, 3, 0
1030 %77:gpr = ADD %dst, %26
1031 PseudoVSE8_V_MF8 killed %76, killed %77, -1, 3
1034 successors: %bb.1(0x7c000000), %bb.4(0x04000000)
1036 %28:gpr = ADD %26, %inc
1037 BLTU %28, %tc, %bb.1