1 ; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 -hexagon-instsimplify=0 < %s | FileCheck %s
4 ; Test that the compiler doesn't assert because IMPLICIT_DEF instructions are
5 ; are added to the same packet as a use. This test case asserts if the
6 ; IMPLICIT_DEFs are not handled properly.
10 ; S2_storerd_io r29, 0, d0
12 ; CHECK: memd(r29+#0) = r{{[0-9]+}}:{{[0-9]+}}
13 ; CHECK: memd(r29+#0) = r{{[0-9]+}}:{{[0-9]+}}
15 define ptr @f0(ptr %a0) local_unnamed_addr {
17 %v0 = tail call ptr @f1(i32 0)
18 %v1 = tail call ptr @f1(i32 8)
19 %v3 = load i32, ptr undef, align 4
20 %v4 = tail call ptr @f4(ptr %a0, i32 0, i32 %v3)
21 %v5 = sub nsw i32 %v3, 0
25 switch i8 undef, label %b3 [
37 b4: ; preds = %b1, %b1
41 br i1 undef, label %b27, label %b6
44 %v6 = ptrtoint ptr %v4 to i32
46 %v8 = call ptr @f4(ptr nonnull %v4, i32 0, i32 %v7)
47 %v9 = call ptr @f4(ptr nonnull %v4, i32 undef, i32 %v5)
51 br i1 undef, label %b8, label %b9
56 b9: ; preds = %b8, %b7
57 %v10 = phi i32 [ 2, %b8 ], [ 0, %b7 ]
58 %v11 = load i8, ptr %v9, align 1
59 switch i8 %v11, label %b12 [
64 b10: ; preds = %b9, %b9
65 br i1 undef, label %b11, label %b12
68 %v12 = call i64 @f6(ptr nonnull %v9, ptr nonnull undef, i32 10)
69 %v13 = load ptr, ptr undef, align 4
70 %v14 = ptrtoint ptr %v13 to i32
73 b12: ; preds = %b10, %b9
74 switch i8 undef, label %b14 [
79 b13: ; preds = %b12, %b12
85 b15: ; preds = %b13, %b11
86 %v15 = phi i32 [ undef, %b13 ], [ %v14, %b11 ]
87 %v16 = phi i32 [ 2, %b13 ], [ 1, %b11 ]
88 %v17 = phi i64 [ undef, %b13 ], [ %v12, %b11 ]
93 %v19 = icmp ne i32 %v10, %v16
94 %v20 = or i1 undef, %v19
95 br i1 %v20, label %b17, label %b18
98 call void @f2(ptr %v8)
102 br i1 undef, label %b19, label %b20
108 %v21 = add i32 %v5, -2
109 %v22 = sub i32 %v21, %v7
110 %v23 = add i32 %v22, %v15
111 %v24 = sub i32 %v23, 0
115 %v25 = icmp ne i32 %v24, 2
116 %v26 = and i1 %v25, undef
117 br i1 %v26, label %b22, label %b23
125 b24: ; preds = %b23, %b19
126 %v27 = phi i64 [ 0, %b19 ], [ %v17, %b23 ]
130 %v28 = icmp sgt i64 0, %v27
131 br i1 %v28, label %b28, label %b26
136 b27: ; preds = %b17, %b5
137 call void @f2(ptr %v4)
138 call void @f2(ptr %v0)
139 %v29 = call ptr @f3(ptr undef, ptr nonnull %a0)
143 call void @f2(ptr %v9)
147 declare ptr @f1(i32) local_unnamed_addr
149 declare void @f2(ptr nocapture) local_unnamed_addr
151 declare ptr @f3(ptr, ptr nocapture readonly) local_unnamed_addr
153 declare ptr @f4(ptr, i32, i32) local_unnamed_addr
155 declare ptr @f5() local_unnamed_addr
157 declare i64 @f6(ptr, ptr, i32) local_unnamed_addr