1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s
4 ; Test that we do not end in an infinite loop (https://github.com/llvm/llvm-project/issues/63322)
6 declare void @llvm.masked.scatter.nxv16i8.nxv16p0(<vscale x 16 x i8>, <vscale x 16 x ptr>, i32 immarg, <vscale x 16 x i1>)
8 define fastcc i8 @allocno_reload_assign() {
9 ; CHECK-LABEL: allocno_reload_assign:
11 ; CHECK-NEXT: mov z0.b, #0 // =0x0
12 ; CHECK-NEXT: ptrue p0.d
13 ; CHECK-NEXT: mov z16.d, #0 // =0x0
14 ; CHECK-NEXT: ptrue p1.b
15 ; CHECK-NEXT: uunpklo z1.h, z0.b
16 ; CHECK-NEXT: uunpkhi z0.h, z0.b
17 ; CHECK-NEXT: uunpklo z2.s, z1.h
18 ; CHECK-NEXT: uunpkhi z3.s, z1.h
19 ; CHECK-NEXT: uunpklo z5.s, z0.h
20 ; CHECK-NEXT: uunpkhi z7.s, z0.h
21 ; CHECK-NEXT: uunpklo z0.d, z2.s
22 ; CHECK-NEXT: uunpkhi z1.d, z2.s
23 ; CHECK-NEXT: uunpklo z2.d, z3.s
24 ; CHECK-NEXT: uunpkhi z3.d, z3.s
25 ; CHECK-NEXT: uunpklo z4.d, z5.s
26 ; CHECK-NEXT: uunpkhi z5.d, z5.s
27 ; CHECK-NEXT: uunpklo z6.d, z7.s
28 ; CHECK-NEXT: uunpkhi z7.d, z7.s
29 ; CHECK-NEXT: .LBB0_1: // =>This Inner Loop Header: Depth=1
30 ; CHECK-NEXT: fmov d17, xzr
31 ; CHECK-NEXT: cmpeq p2.d, p0/z, z17.d, #0
32 ; CHECK-NEXT: uzp1 p2.s, p2.s, p0.s
33 ; CHECK-NEXT: uzp1 p2.h, p2.h, p0.h
34 ; CHECK-NEXT: uzp1 p2.b, p2.b, p0.b
35 ; CHECK-NEXT: mov z17.b, p2/z, #1 // =0x1
36 ; CHECK-NEXT: fmov w8, s17
37 ; CHECK-NEXT: sbfx x8, x8, #0, #1
38 ; CHECK-NEXT: whilelo p2.b, xzr, x8
39 ; CHECK-NEXT: not p2.b, p1/z, p2.b
40 ; CHECK-NEXT: punpklo p3.h, p2.b
41 ; CHECK-NEXT: punpkhi p2.h, p2.b
42 ; CHECK-NEXT: punpklo p4.h, p3.b
43 ; CHECK-NEXT: punpkhi p3.h, p3.b
44 ; CHECK-NEXT: punpklo p5.h, p4.b
45 ; CHECK-NEXT: punpkhi p4.h, p4.b
46 ; CHECK-NEXT: st1b { z0.d }, p5, [z16.d]
47 ; CHECK-NEXT: st1b { z1.d }, p4, [z16.d]
48 ; CHECK-NEXT: punpklo p4.h, p3.b
49 ; CHECK-NEXT: punpkhi p3.h, p3.b
50 ; CHECK-NEXT: st1b { z2.d }, p4, [z16.d]
51 ; CHECK-NEXT: punpklo p4.h, p2.b
52 ; CHECK-NEXT: punpkhi p2.h, p2.b
53 ; CHECK-NEXT: st1b { z3.d }, p3, [z16.d]
54 ; CHECK-NEXT: punpklo p3.h, p4.b
55 ; CHECK-NEXT: st1b { z4.d }, p3, [z16.d]
56 ; CHECK-NEXT: punpkhi p3.h, p4.b
57 ; CHECK-NEXT: st1b { z5.d }, p3, [z16.d]
58 ; CHECK-NEXT: punpklo p3.h, p2.b
59 ; CHECK-NEXT: punpkhi p2.h, p2.b
60 ; CHECK-NEXT: st1b { z6.d }, p3, [z16.d]
61 ; CHECK-NEXT: st1b { z7.d }, p2, [z16.d]
62 ; CHECK-NEXT: b .LBB0_1
66 call void @llvm.masked.scatter.nxv16i8.nxv16p0(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x ptr> zeroinitializer, i32 0, <vscale x 16 x i1> xor (<vscale x 16 x i1> shufflevector (<vscale x 16 x i1> icmp eq (<vscale x 16 x ptr> insertelement (<vscale x 16 x ptr> poison, ptr null, i64 0), <vscale x 16 x ptr> zeroinitializer), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer), <vscale x 16 x i1> shufflevector (<vscale x 16 x i1> insertelement (<vscale x 16 x i1> poison, i1 true, i32 0), <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer)))
70 uselistorder <vscale x 16 x i1> poison, { 1, 2, 0 }