1 ; RUN: llc -O2 -mcpu=hexagonv5 < %s | FileCheck %s
2 ; Check if the three stores in the loop were predicated.
7 target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
8 target triple = "hexagon"
10 define void @fred(i32 %n, i32* %bp) nounwind {
12 %cmp16 = icmp eq i32 %n, 0
13 br i1 %cmp16, label %for.end, label %for.body.lr.ph
15 for.body.lr.ph: ; preds = %entry
16 %cmp2 = icmp ugt i32 %n, 32
19 for.body: ; preds = %for.inc, %for.body.lr.ph
20 %i.017 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
21 %call = tail call i32 @foo(i32* %bp) nounwind
22 %call1 = tail call i32 @bar(i32* %bp) nounwind
23 br i1 %cmp2, label %if.then, label %if.else
25 if.then: ; preds = %for.body
26 %arrayidx = getelementptr inbounds i32, i32* %bp, i32 %i.017
27 store i32 %call, i32* %arrayidx, align 4, !tbaa !0
28 %add = add i32 %i.017, 2
29 %arrayidx3 = getelementptr inbounds i32, i32* %bp, i32 %add
30 store i32 %call1, i32* %arrayidx3, align 4, !tbaa !0
33 if.else: ; preds = %for.body
34 %or = or i32 %call1, %call
35 %arrayidx4 = getelementptr inbounds i32, i32* %bp, i32 %i.017
36 store i32 %or, i32* %arrayidx4, align 4, !tbaa !0
39 for.inc: ; preds = %if.then, %if.else
40 %inc = add i32 %i.017, 1
41 %exitcond = icmp eq i32 %inc, %n
42 br i1 %exitcond, label %for.end.loopexit, label %for.body
44 for.end.loopexit: ; preds = %for.inc
47 for.end: ; preds = %for.end.loopexit, %entry
51 declare i32 @foo(i32*) nounwind
53 declare i32 @bar(i32*) nounwind
56 !1 = !{!"omnipotent char", !2}
57 !2 = !{!"Simple C/C++ TBAA"}