1 ; RUN: llc -march=hexagon -function-sections < %s | FileCheck %s
3 ; CHECK-NOT: if (p0.new)
6 target triple = "hexagon-unknown--elf"
8 %s.0 = type { ptr, ptr }
9 %s.1 = type { i8, [2 x ptr] }
10 %s.2 = type { i32, i32 }
12 @g0 = internal constant %s.0 zeroinitializer, align 4
14 ; Function Attrs: minsize nounwind
15 define i32 @f0(ptr %a0) #0 {
17 %v0 = tail call i32 @f1(ptr %a0, i32 0)
21 ; Function Attrs: minsize nounwind
22 define internal i32 @f1(ptr %a0, i32 %a1) #0 {
24 %v0 = icmp eq ptr %a0, null
25 br i1 %v0, label %b4, label %b1
28 %v1 = icmp eq i32 %a1, 1
29 br i1 %v1, label %b3, label %b2
32 tail call void @f2(ptr null) #3
36 tail call void @f2(ptr @g0) #3
40 %v2 = load ptr, ptr inttoptr (i32 4 to ptr), align 4, !tbaa !0
41 %v3 = icmp eq ptr %v2, null
42 br i1 %v3, label %b5, label %b6
45 tail call void @f3(i32 0) #4
49 %v4 = tail call zeroext i8 @f4(ptr null) #4
50 %v5 = icmp eq i8 %v4, 0
51 br i1 %v5, label %b7, label %b8
54 tail call void @f3(i32 0) #4
58 %v6 = load ptr, ptr inttoptr (i32 4 to ptr), align 4, !tbaa !0
59 %v7 = icmp eq i32 %a1, 1
60 %v8 = getelementptr inbounds %s.2, ptr %v6, i32 0, i32 1
61 %v10 = select i1 %v7, ptr %v8, ptr %v6
62 %v11 = tail call i32 @f5(ptr %v10) #4
65 b9: ; preds = %b8, %b7
66 %v12 = phi i32 [ 0, %b7 ], [ %v11, %b8 ]
67 tail call void @f3(i32 %v12) #4
70 b10: ; preds = %b9, %b5
71 %v13 = phi i32 [ 0, %b5 ], [ %v12, %b9 ]
75 ; Function Attrs: noreturn optsize
76 declare void @f2(ptr) #1
78 ; Function Attrs: optsize
79 declare void @f3(i32) #2
81 ; Function Attrs: optsize
82 declare zeroext i8 @f4(ptr) #2
84 ; Function Attrs: optsize
85 declare i32 @f5(ptr) #2
87 ; Function Attrs: minsize nounwind
88 define i32 @f6(ptr %a0) #0 {
90 %v0 = tail call i32 @f1(ptr %a0, i32 1)
94 attributes #0 = { minsize nounwind }
95 attributes #1 = { noreturn optsize }
96 attributes #2 = { optsize }
97 attributes #3 = { noreturn nounwind optsize }
98 attributes #4 = { nounwind optsize }
100 !0 = !{!1, !1, i64 0}
101 !1 = !{!"any pointer", !2, i64 0}
102 !2 = !{!"omnipotent char", !3, i64 0}
103 !3 = !{!"Simple C/C++ TBAA"}