1 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
2 ; Check if the three stores in the loop were predicated.
7 target triple = "hexagon"
9 define void @fred(i32 %n, ptr %bp) #0 {
11 %cmp16 = icmp eq i32 %n, 0
12 br i1 %cmp16, label %for.end, label %for.body.lr.ph
14 for.body.lr.ph: ; preds = %entry
15 %cmp2 = icmp ugt i32 %n, 32
18 for.body: ; preds = %for.inc, %for.body.lr.ph
19 %i.017 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
20 %call = tail call i32 @foo(ptr %bp) nounwind
21 %call1 = tail call i32 @bar(ptr %bp) nounwind
22 br i1 %cmp2, label %if.then, label %if.else
24 if.then: ; preds = %for.body
25 %arrayidx = getelementptr inbounds i32, ptr %bp, i32 %i.017
26 store i32 %call, ptr %arrayidx, align 4, !tbaa !0
27 %add = add i32 %i.017, 2
28 %arrayidx3 = getelementptr inbounds i32, ptr %bp, i32 %add
29 store i32 %call1, ptr %arrayidx3, align 4, !tbaa !0
32 if.else: ; preds = %for.body
33 %or = or i32 %call1, %call
34 %arrayidx4 = getelementptr inbounds i32, ptr %bp, i32 %i.017
35 store i32 %or, ptr %arrayidx4, align 4, !tbaa !0
38 for.inc: ; preds = %if.then, %if.else
39 %inc = add i32 %i.017, 1
40 %exitcond = icmp eq i32 %inc, %n
41 br i1 %exitcond, label %for.end.loopexit, label %for.body
43 for.end.loopexit: ; preds = %for.inc
46 for.end: ; preds = %for.end.loopexit, %entry
50 declare i32 @foo(ptr) nounwind
52 declare i32 @bar(ptr) nounwind
54 attributes #0 = { nounwind "target-cpu"="hexagonv5" }
57 !1 = !{!"omnipotent char", !2}
58 !2 = !{!"Simple C/C++ TBAA"}