1 ; RUN: llc -march=hexagon -O2 < %s
3 ; Check for successful compilation.
5 target triple = "hexagon"
7 %s.0 = type { [1 x i32] }
8 %s.1 = type { %s.2, i8, %s.6 }
13 %s.6 = type { ptr, ptr }
15 @g0 = external constant ptr
16 @g1 = external global i32
17 @g2 = internal global %s.1 zeroinitializer, section ".data..percpu", align 4
18 @g3 = external global [3 x i32]
19 @g4 = private unnamed_addr constant [29 x i8] c"BUG: failure at %s:%d/%s()!\0A\00", align 1
20 @g5 = private unnamed_addr constant [22 x i8] c"kernel/stop_machine.c\00", align 1
21 @g6 = private unnamed_addr constant [14 x i8] c"cpu_stop_init\00", align 1
22 @g7 = private unnamed_addr constant [5 x i8] c"BUG!\00", align 1
24 ; Function Attrs: nounwind
25 define internal i32 @f0() #0 section ".init.text" {
27 %v0 = alloca i32, align 4
28 %v1 = load ptr, ptr @g0, align 4, !tbaa !0
29 %v3 = tail call i32 @f1(ptr %v1, i32 3, i32 0) #0
30 %v4 = load i32, ptr @g1, align 4, !tbaa !4
31 %v5 = icmp ult i32 %v3, %v4
32 br i1 %v5, label %b1, label %b4
37 b2: ; preds = %b2, %b1
38 %v6 = phi i32 [ %v18, %b2 ], [ %v3, %b1 ]
39 %v7 = tail call i32 asm "", "=r,0"(ptr @g2) #0, !srcloc !6
40 %v8 = getelementptr inbounds [3 x i32], ptr @g3, i32 0, i32 %v6
41 %v9 = load i32, ptr %v8, align 4, !tbaa !7
42 %v10 = add i32 %v9, %v7
43 %v11 = inttoptr i32 %v10 to ptr
44 store volatile i32 0, ptr %v0, align 4
45 %v13 = load volatile i32, ptr %v0, align 4
46 store volatile i32 %v13, ptr %v11, align 4
47 %v14 = getelementptr inbounds %s.1, ptr %v11, i32 0, i32 2
48 store ptr %v14, ptr %v14, align 4, !tbaa !9
49 %v16 = getelementptr inbounds %s.1, ptr %v11, i32 0, i32 2, i32 1
50 store ptr %v14, ptr %v16, align 4, !tbaa !11
52 %v18 = tail call i32 @f1(ptr %v1, i32 3, i32 %v17) #0
53 %v19 = load i32, ptr @g1, align 4, !tbaa !4
54 %v20 = icmp ult i32 %v18, %v19
55 br i1 %v20, label %b2, label %b3
60 b4: ; preds = %b3, %b0
61 %v21 = tail call i32 @f2() #0
62 %v22 = icmp eq i32 %v21, 0
63 br i1 %v22, label %b6, label %b5, !prof !12
66 %v23 = tail call i32 (ptr, ...) @f3(ptr @g4, ptr @g5, i32 354, ptr @g6) #0
67 tail call void (ptr, ...) @f4(ptr @g7) #1
74 ; Function Attrs: nounwind
75 declare i32 @f1(ptr, i32, i32) #0
77 ; Function Attrs: nounwind
80 ; Function Attrs: nounwind
81 declare i32 @f3(ptr, ...) #0
83 ; Function Attrs: noreturn
84 declare void @f4(ptr, ...) #1
86 attributes #0 = { nounwind "target-cpu"="hexagonv55" }
87 attributes #1 = { noreturn }
90 !1 = !{!"any pointer", !2, i64 0}
91 !2 = !{!"omnipotent char", !3, i64 0}
92 !3 = !{!"Simple C/C++ TBAA"}
94 !5 = !{!"int", !2, i64 0}
97 !8 = !{!"long", !2, i64 0}
98 !9 = !{!10, !1, i64 0}
99 !10 = !{!"list_head", !1, i64 0, !1, i64 4}
100 !11 = !{!10, !1, i64 4}
101 !12 = !{!"branch_weights", i32 64, i32 4}