1 ; RUN: llc -O2 -march=hexagon -mcpu=hexagonv5 < %s
3 ; Check for successful compilation.
5 @c = common global i32 0, align 4
6 @e = common global i32 0, align 4
7 @g = common global ptr null, align 4
8 @a = common global i32 0, align 4
9 @b = common global i32 0, align 4
10 @h = common global ptr null, align 4
11 @d = common global i32 0, align 4
12 @f = common global i32 0, align 4
14 define i32 @fn1(ptr nocapture readnone %p1) #0 {
16 %0 = load ptr, ptr @h, align 4
17 %1 = load ptr, ptr @g, align 4
18 %.pre = load i32, ptr @c, align 4
22 %2 = phi i32 [ %10, %if.end ], [ %.pre, %entry ]
23 store i32 %2, ptr @e, align 4
24 %tobool5 = icmp eq i32 %2, 0
25 br i1 %tobool5, label %for.end, label %for.body.lr.ph
34 %add6 = phi i32 [ %2, %for.body.lr.ph ], [ %add, %for.body ]
35 %6 = load i32, ptr %1, align 4
36 store i32 %6, ptr @a, align 4
37 %add = add nsw i32 %add6, 5
38 %tobool = icmp eq i32 %add, 0
39 br i1 %tobool, label %for.cond1.for.end_crit_edge, label %for.body
41 for.cond1.for.end_crit_edge:
44 store i32 %8, ptr @e, align 4
48 %9 = load i32, ptr @b, align 4
49 %tobool2 = icmp eq i32 %9, 0
50 br i1 %tobool2, label %if.end, label %if.then
53 store i32 0, ptr %0, align 4
54 %.pre7 = load i32, ptr @c, align 4
58 %10 = phi i32 [ %2, %for.end ], [ %.pre7, %if.then ]
59 store i32 %10, ptr @d, align 4
60 %11 = load i32, ptr @f, align 4
61 %inc = add nsw i32 %11, 1
62 store i32 %inc, ptr @f, align 4