1 ; RUN: llc -march=hexagon -machine-sink-split < %s
3 ; MachineSink should not sink an MI which is used in a non-phi instruction
4 ; in an MBB with multiple predecessors.
6 target triple = "hexagon-unknown--elf"
8 ; Function Attrs: nounwind
11 br i1 undef, label %b1, label %b2
17 %v0 = load ptr, ptr undef, align 4
18 %v1 = getelementptr inbounds i8, ptr %v0, i32 1
19 %v2 = load i8, ptr %v0, align 1, !tbaa !0
20 %v3 = zext i8 %v2 to i32
21 %v4 = shl nuw nsw i32 %v3, 8
22 br i1 undef, label %b3, label %b5
25 br i1 undef, label %b15, label %b4
30 b5: ; preds = %b4, %b2
31 %v5 = phi ptr [ undef, %b4 ], [ %v1, %b2 ]
32 %v6 = load i8, ptr %v5, align 1, !tbaa !0
33 %v7 = zext i8 %v6 to i32
34 %v8 = add nsw i32 %v7, %v4
35 %v9 = add nsw i32 %v8, -2
38 b6: ; preds = %b8, %b5
39 br i1 false, label %b7, label %b8
45 br i1 undef, label %b6, label %b9
48 br i1 undef, label %b10, label %b14
51 br i1 undef, label %b11, label %b13
54 br i1 undef, label %b12, label %b13
59 b13: ; preds = %b11, %b10
60 store i32 %v9, ptr undef, align 4, !tbaa !3
70 attributes #0 = { nounwind }
73 !1 = !{!"omnipotent char", !2, i64 0}
74 !2 = !{!"Simple C/C++ TBAA"}
76 !4 = !{!"int", !1, i64 0}