1 ; RUN: llc -march=hexagon -enable-aa-sched-mi -enable-pipeliner \
2 ; RUN: -hexagon-expand-condsets=0 -pipeliner-max-stages=2 < %s
5 ; Disable expand-condsets because it will assert on undefined registers.
7 ; Test that we generate pipelines with multiple stages correctly.
9 %s.0 = type { [194 x i32], ptr, [10 x i32], [10 x i32], i32, i32, i32, i32, i32, [9 x i32], [9 x i32], i16, i16, i16, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
10 %s.1 = type { [60 x i32], i16 }
11 %s.2 = type { i32, [7 x i32], i16 }
12 %s.3 = type { [10 x i32] }
13 %s.4 = type { [10 x i32], [10 x i32] }
14 %s.5 = type { [5 x i32], i32, i32 }
15 %s.6 = type { [5 x i32], i32, i32 }
16 %s.7 = type { [4 x i32], [4 x i32] }
17 %s.8 = type { [5 x i32], i32, i32, i16, i16 }
18 %s.9 = type { i8, i32, i32, i32, [10 x i32], [10 x i32], [80 x i32], [80 x i32], [8 x i32], i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
20 ; Function Attrs: nounwind
21 define fastcc void @f0(ptr %a0) #0 {
23 %v0 = alloca [40 x i32], align 8
24 %v1 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 5
25 %v2 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 6
26 %v3 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 4
27 %v4 = select i1 undef, ptr %v2, ptr %v1
28 %v5 = load i32, ptr %v4, align 4
29 br i1 false, label %b2, label %b1
32 %v6 = load i32, ptr %v3, align 4
35 b2: ; preds = %b1, %b0
36 %v7 = phi i32 [ %v6, %b1 ], [ undef, %b0 ]
38 br i1 undef, label %b3, label %b4
40 b3: ; preds = %b3, %b2
41 %v9 = phi i32 [ %v34, %b3 ], [ %v5, %b2 ]
42 %v10 = add nsw i32 %v9, 2
43 %v11 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 undef
44 %v12 = load i32, ptr %v11, align 4
45 %v13 = mul nsw i32 %v12, %v8
46 %v14 = ashr i32 %v13, 15
47 %v15 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 %v10
48 %v16 = add nsw i32 %v14, 0
49 store i32 %v16, ptr %v15, align 4
50 %v17 = add nsw i32 %v9, 3
51 %v18 = sub nsw i32 %v17, %v5
52 %v19 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 %v18
53 %v20 = load i32, ptr %v19, align 4
54 %v21 = mul nsw i32 %v20, %v8
55 %v22 = ashr i32 %v21, 15
56 %v23 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 %v17
57 %v24 = add nsw i32 %v22, 0
58 store i32 %v24, ptr %v23, align 4
59 %v25 = add nsw i32 %v9, 6
60 %v26 = sub nsw i32 %v25, %v5
61 %v27 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 %v26
62 %v28 = load i32, ptr %v27, align 4
63 %v29 = mul nsw i32 %v28, %v8
64 %v30 = ashr i32 %v29, 15
65 %v31 = getelementptr inbounds [40 x i32], ptr %v0, i32 0, i32 %v25
66 %v32 = load i32, ptr %v31, align 4
67 %v33 = add nsw i32 %v30, %v32
68 store i32 %v33, ptr %v31, align 4
69 %v34 = add nsw i32 %v9, 8
70 %v35 = icmp slt i32 %v34, 33
71 br i1 %v35, label %b3, label %b4
73 b4: ; preds = %b4, %b3, %b2
77 attributes #0 = { nounwind "target-cpu"="hexagonv55" }