1 ; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=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 i8** @f0(i8* %a0) local_unnamed_addr {
17 %v0 = tail call i8* @f1(i32 0)
18 %v1 = tail call i8* @f1(i32 8)
19 %v2 = bitcast i8* %v1 to i8**
20 %v3 = load i32, i32* undef, align 4
21 %v4 = tail call i8* @f4(i8* %a0, i32 0, i32 %v3)
22 %v5 = sub nsw i32 %v3, 0
26 switch i8 undef, label %b3 [
38 b4: ; preds = %b1, %b1
42 br i1 undef, label %b27, label %b6
45 %v6 = ptrtoint i8* %v4 to i32
47 %v8 = call i8* @f4(i8* nonnull %v4, i32 0, i32 %v7)
48 %v9 = call i8* @f4(i8* nonnull %v4, i32 undef, i32 %v5)
52 br i1 undef, label %b8, label %b9
57 b9: ; preds = %b8, %b7
58 %v10 = phi i32 [ 2, %b8 ], [ 0, %b7 ]
59 %v11 = load i8, i8* %v9, align 1
60 switch i8 %v11, label %b12 [
65 b10: ; preds = %b9, %b9
66 br i1 undef, label %b11, label %b12
69 %v12 = call i64 @f6(i8* nonnull %v9, i8** nonnull undef, i32 10)
70 %v13 = load i8*, i8** undef, align 4
71 %v14 = ptrtoint i8* %v13 to i32
74 b12: ; preds = %b10, %b9
75 switch i8 undef, label %b14 [
80 b13: ; preds = %b12, %b12
86 b15: ; preds = %b13, %b11
87 %v15 = phi i32 [ undef, %b13 ], [ %v14, %b11 ]
88 %v16 = phi i32 [ 2, %b13 ], [ 1, %b11 ]
89 %v17 = phi i64 [ undef, %b13 ], [ %v12, %b11 ]
90 %v18 = call i32* @f5()
94 %v19 = icmp ne i32 %v10, %v16
95 %v20 = or i1 undef, %v19
96 br i1 %v20, label %b17, label %b18
99 call void @f2(i8* %v8)
103 br i1 undef, label %b19, label %b20
109 %v21 = add i32 %v5, -2
110 %v22 = sub i32 %v21, %v7
111 %v23 = add i32 %v22, %v15
112 %v24 = sub i32 %v23, 0
116 %v25 = icmp ne i32 %v24, 2
117 %v26 = and i1 %v25, undef
118 br i1 %v26, label %b22, label %b23
126 b24: ; preds = %b23, %b19
127 %v27 = phi i64 [ 0, %b19 ], [ %v17, %b23 ]
131 %v28 = icmp sgt i64 undef, %v27
132 br i1 %v28, label %b28, label %b26
137 b27: ; preds = %b17, %b5
138 call void @f2(i8* %v4)
139 call void @f2(i8* %v0)
140 %v29 = call i8* @f3(i8* undef, i8* nonnull %a0)
144 call void @f2(i8* %v9)
148 declare i8* @f1(i32) local_unnamed_addr
150 declare void @f2(i8* nocapture) local_unnamed_addr
152 declare i8* @f3(i8*, i8* nocapture readonly) local_unnamed_addr
154 declare i8* @f4(i8*, i32, i32) local_unnamed_addr
156 declare i32* @f5() local_unnamed_addr
158 declare i64 @f6(i8*, i8**, i32) local_unnamed_addr