45 lines · plain
1; RUN: llc -mtriple=hexagon -disable-machine-licm -hwloop-spec-preheader=1 < %s | FileCheck %s2; CHECK: loop03 4target triple = "hexagon"5 6define i32 @foo(i32 %x, i32 %n, ptr nocapture %A, ptr nocapture %B) #0 {7entry:8 %cmp = icmp sgt i32 %x, 09 br i1 %cmp, label %for.cond.preheader, label %return10 11for.cond.preheader: ; preds = %entry12 %cmp16 = icmp sgt i32 %n, 013 br i1 %cmp16, label %for.body.preheader, label %return14 15for.body.preheader: ; preds = %for.cond.preheader16 br label %for.body17 18for.body: ; preds = %for.body.preheader, %for.body19 %arrayidx.phi = phi ptr [ %arrayidx.inc, %for.body ], [ %B, %for.body.preheader ]20 %arrayidx2.phi = phi ptr [ %arrayidx2.inc, %for.body ], [ %A, %for.body.preheader ]21 %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]22 %0 = load i32, ptr %arrayidx.phi, align 4, !tbaa !023 %1 = load i32, ptr %arrayidx2.phi, align 4, !tbaa !024 %add = add nsw i32 %1, %025 store i32 %add, ptr %arrayidx2.phi, align 4, !tbaa !026 %inc = add nsw i32 %i.07, 127 %exitcond = icmp eq i32 %inc, %n28 %arrayidx.inc = getelementptr i32, ptr %arrayidx.phi, i32 129 %arrayidx2.inc = getelementptr i32, ptr %arrayidx2.phi, i32 130 br i1 %exitcond, label %return.loopexit, label %for.body31 32return.loopexit: ; preds = %for.body33 br label %return34 35return: ; preds = %return.loopexit, %for.cond.preheader, %entry36 %retval.0 = phi i32 [ 2, %entry ], [ 0, %for.cond.preheader ], [ 0, %return.loopexit ]37 ret i32 %retval.038}39 40!0 = !{!"int", !1}41!1 = !{!"omnipotent char", !2}42!2 = !{!"Simple C/C++ TBAA"}43 44attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="-hvx" }45