@@ -9,7 +9,7 @@ target triple = "aarch64-unknown-linux-gnu"
9
9
; here, only that this case no longer causes said crash.
10
10
define dso_local i32 @dupext_crashtest (i32 %e ) local_unnamed_addr {
11
11
; CHECK-LABEL: dupext_crashtest:
12
- ; CHECK: // %bb.0: // %for.body.lr.ph
12
+ ; CHECK: // %bb.0: // %entry
13
13
; CHECK-NEXT: dup v0.2s, w0
14
14
; CHECK-NEXT: .LBB0_1: // %vector.body
15
15
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
@@ -18,7 +18,7 @@ define dso_local i32 @dupext_crashtest(i32 %e) local_unnamed_addr {
18
18
; CHECK-NEXT: xtn v1.2s, v1.2d
19
19
; CHECK-NEXT: str d1, [x8]
20
20
; CHECK-NEXT: b .LBB0_1
21
- for.body.lr.ph :
21
+ entry :
22
22
%conv314 = zext i32 %e to i64
23
23
br label %vector.memcheck
24
24
@@ -40,3 +40,49 @@ vector.body: ; preds = %vector.body, %vecto
40
40
store <2 x i32 > %3 , ptr %4 , align 4
41
41
br label %vector.body
42
42
}
43
+
44
+ ; This test got stuck in a loop hoisting the and to the load, and sinking it back to the mull
45
+ define i32 @dup_and_load (ptr %p , i1 %c ) {
46
+ ; CHECK-LABEL: dup_and_load:
47
+ ; CHECK: // %bb.0: // %entry
48
+ ; CHECK-NEXT: mov x8, x0
49
+ ; CHECK-NEXT: ldrb w0, [x0]
50
+ ; CHECK-NEXT: tbz w1, #0, .LBB1_3
51
+ ; CHECK-NEXT: // %bb.1: // %ph
52
+ ; CHECK-NEXT: dup v0.8h, w0
53
+ ; CHECK-NEXT: mov w9, wzr
54
+ ; CHECK-NEXT: .LBB1_2: // %vector.body
55
+ ; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
56
+ ; CHECK-NEXT: ldr d1, [x8]
57
+ ; CHECK-NEXT: add w9, w9, #1
58
+ ; CHECK-NEXT: cmp w9, #100
59
+ ; CHECK-NEXT: ushll v1.8h, v1.8b, #0
60
+ ; CHECK-NEXT: umull2 v2.4s, v0.8h, v1.8h
61
+ ; CHECK-NEXT: umull v1.4s, v0.4h, v1.4h
62
+ ; CHECK-NEXT: stp q1, q2, [x8]
63
+ ; CHECK-NEXT: b.lt .LBB1_2
64
+ ; CHECK-NEXT: .LBB1_3: // %end
65
+ ; CHECK-NEXT: ret
66
+ entry:
67
+ %l = load i32 , ptr %p
68
+ %and255 = and i32 %l , 255
69
+ br i1 %c , label %ph , label %end
70
+
71
+ ph:
72
+ %broadcast.splatinsert = insertelement <8 x i32 > poison, i32 %and255 , i32 0
73
+ %broadcast.splat = shufflevector <8 x i32 > %broadcast.splatinsert , <8 x i32 > poison, <8 x i32 > zeroinitializer
74
+ br label %vector.body
75
+
76
+ vector.body: ; preds = %vector.body, %vector.ph
77
+ %iv = phi i32 [ 0 , %ph ], [ %iv.next , %vector.body ]
78
+ %wide.load = load <8 x i8 >, ptr %p , align 4
79
+ %0 = zext <8 x i8 > %wide.load to <8 x i32 >
80
+ %1 = mul <8 x i32 > %broadcast.splat , %0
81
+ store <8 x i32 > %1 , ptr %p , align 4
82
+ %iv.next = add i32 %iv , 1
83
+ %e = icmp slt i32 %iv.next , 100
84
+ br i1 %e , label %vector.body , label %end
85
+
86
+ end:
87
+ ret i32 %and255
88
+ }
0 commit comments