1 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s 2 ; Check if the three stores in the loop were predicated. 3 ; CHECK: if{{.*}}memw 4 ; CHECK: if{{.*}}memw 5 ; CHECK: if{{.*}}memw 6 7 target triple = "hexagon" 8 9 define void @fred(i32 %n, i32* %bp) #0 { 10 entry: 11 %cmp16 = icmp eq i32 %n, 0 12 br i1 %cmp16, label %for.end, label %for.body.lr.ph 13 14 for.body.lr.ph: ; preds = %entry 15 %cmp2 = icmp ugt i32 %n, 32 16 br label %for.body 17 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(i32* %bp) nounwind 21 %call1 = tail call i32 @bar(i32* %bp) nounwind 22 br i1 %cmp2, label %if.then, label %if.else 23 24 if.then: ; preds = %for.body 25 %arrayidx = getelementptr inbounds i32, i32* %bp, i32 %i.017 26 store i32 %call, i32* %arrayidx, align 4, !tbaa !0 27 %add = add i32 %i.017, 2 28 %arrayidx3 = getelementptr inbounds i32, i32* %bp, i32 %add 29 store i32 %call1, i32* %arrayidx3, align 4, !tbaa !0 30 br label %for.inc 31 32 if.else: ; preds = %for.body 33 %or = or i32 %call1, %call 34 %arrayidx4 = getelementptr inbounds i32, i32* %bp, i32 %i.017 35 store i32 %or, i32* %arrayidx4, align 4, !tbaa !0 36 br label %for.inc 37 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 42 43 for.end.loopexit: ; preds = %for.inc 44 br label %for.end 45 46 for.end: ; preds = %for.end.loopexit, %entry 47 ret void 48 } 49 50 declare i32 @foo(i32*) nounwind 51 52 declare i32 @bar(i32*) nounwind 53 54 attributes #0 = { nounwind "target-cpu"="hexagonv5" } 55 56 !0 = !{!"int", !1} 57 !1 = !{!"omnipotent char", !2} 58 !2 = !{!"Simple C/C++ TBAA"} 59