59 lines · plain
1; RUN: llc -mtriple=hexagon -O2 < %s | FileCheck %s2; Check if the three stores in the loop were predicated.3; CHECK: if{{.*}}memw4; CHECK: if{{.*}}memw5; CHECK: if{{.*}}memw6 7target triple = "hexagon"8 9define void @fred(i32 %n, ptr %bp) #0 {10entry:11 %cmp16 = icmp eq i32 %n, 012 br i1 %cmp16, label %for.end, label %for.body.lr.ph13 14for.body.lr.ph: ; preds = %entry15 %cmp2 = icmp ugt i32 %n, 3216 br label %for.body17 18for.body: ; preds = %for.inc, %for.body.lr.ph19 %i.017 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]20 %call = tail call i32 @foo(ptr %bp) nounwind21 %call1 = tail call i32 @bar(ptr %bp) nounwind22 br i1 %cmp2, label %if.then, label %if.else23 24if.then: ; preds = %for.body25 %arrayidx = getelementptr inbounds i32, ptr %bp, i32 %i.01726 store i32 %call, ptr %arrayidx, align 4, !tbaa !027 %add = add i32 %i.017, 228 %arrayidx3 = getelementptr inbounds i32, ptr %bp, i32 %add29 store i32 %call1, ptr %arrayidx3, align 4, !tbaa !030 br label %for.inc31 32if.else: ; preds = %for.body33 %or = or i32 %call1, %call34 %arrayidx4 = getelementptr inbounds i32, ptr %bp, i32 %i.01735 store i32 %or, ptr %arrayidx4, align 4, !tbaa !036 br label %for.inc37 38for.inc: ; preds = %if.then, %if.else39 %inc = add i32 %i.017, 140 %exitcond = icmp eq i32 %inc, %n41 br i1 %exitcond, label %for.end.loopexit, label %for.body42 43for.end.loopexit: ; preds = %for.inc44 br label %for.end45 46for.end: ; preds = %for.end.loopexit, %entry47 ret void48}49 50declare i32 @foo(ptr) nounwind51 52declare i32 @bar(ptr) nounwind53 54attributes #0 = { nounwind "target-cpu"="hexagonv5" }55 56!0 = !{!"int", !1}57!1 = !{!"omnipotent char", !2}58!2 = !{!"Simple C/C++ TBAA"}59