brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · 327df6a Raw
92 lines · plain
1; REQUIRES: asserts2 3; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -force-vector-width=4 \4; RUN: -force-tail-folding-style=data-with-evl \5; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \6; RUN: -mtriple=x86_64 -mattr=+avx512f -disable-output < %s 2>&1 | FileCheck --check-prefix=IF-EVL %s7 8; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -force-vector-width=4 \9; RUN: -force-tail-folding-style=none \10; RUN: -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue \11; RUN: -mtriple=x86_64 -mattr=+avx512f -disable-output < %s 2>&1 | FileCheck --check-prefix=NO-VP %s12 13define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {14; IF-EVL: VPlan 'Initial VPlan for VF={4},UF>=1' {15; IF-EVL-NEXT: Live-in vp<[[VF:%[0-9]+]]> = VF16; IF-EVL-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF17; IF-EVL-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count18; IF-EVL-NEXT: Live-in vp<[[BETC:%[0-9]+]]> = backedge-taken count19; IF-EVL-NEXT: Live-in ir<%N> = original trip-count20; IF-EVL-EMPTY:21; IF-EVL:      vector.ph:22; IF-EVL-NEXT: Successor(s): vector loop23; IF-EVL-EMPTY:24; IF-EVL-NEXT: <x1> vector loop: {25; IF-EVL-NEXT:  vector.body:26; IF-EVL-NEXT:    EMIT vp<[[IV:%[0-9]+]]> = CANONICAL-INDUCTION27; IF-EVL-NEXT:    vp<[[ST:%[0-9]+]]>    = SCALAR-STEPS vp<[[IV]]>, ir<1>, vp<[[VF]]>28; IF-EVL-NEXT:    EMIT vp<[[VIV:%[0-9]+]]> = WIDEN-CANONICAL-INDUCTION vp<[[IV]]>29; IF-EVL-NEXT:    EMIT vp<[[MASK:%[0-9]+]]> = icmp ule vp<[[VIV]]>, vp<[[BETC]]>30; IF-EVL-NEXT:    CLONE ir<[[GEP1:%.+]]> = getelementptr inbounds ir<%b>, vp<[[ST]]>31; IF-EVL-NEXT:    vp<[[PTR1:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP1]]>32; IF-EVL-NEXT:    WIDEN ir<[[LD1:%.+]]> = load vp<[[PTR1]]>, vp<[[MASK]]>33; IF-EVL-NEXT:    CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%c>, vp<[[ST]]>34; IF-EVL-NEXT:    vp<[[PTR2:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP2]]>35; IF-EVL-NEXT:    WIDEN ir<[[LD2:%.+]]> = load vp<[[PTR2]]>, vp<[[MASK]]>36; IF-EVL-NEXT:    WIDEN ir<[[ADD:%.+]]> = add nsw ir<[[LD2]]>, ir<[[LD1]]>37; IF-EVL-NEXT:    CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>38; IF-EVL-NEXT:    vp<[[PTR3:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP3]]>39; IF-EVL-NEXT:    WIDEN store vp<[[PTR3]]>, ir<[[ADD]]>, vp<[[MASK]]>40; IF-EVL-NEXT:    EMIT vp<[[IV_NEXT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>41; IF-EVL-NEXT:    EMIT branch-on-count  vp<[[IV_NEXT]]>, vp<[[VTC]]>42; IF-EVL-NEXT:  No successors43; IF-EVL-NEXT: }44 45; NO-VP: VPlan 'Initial VPlan for VF={4},UF>=1' {46; NO-VP-NEXT: Live-in vp<[[VF:%[0-9]+]]> = VF47; NO-VP-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF48; NO-VP-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count49; NO-VP-NEXT: Live-in ir<%N> = original trip-count50; NO-VP-EMPTY:51; NO-VP:      vector.ph:52; NO-VP-NEXT: Successor(s): vector loop53; NO-VP-EMPTY:54; NO-VP-NEXT: <x1> vector loop: {55; NO-VP-NEXT:  vector.body:56; NO-VP-NEXT:    EMIT vp<[[IV:%[0-9]+]]> = CANONICAL-INDUCTION57; NO-VP-NEXT:    vp<[[ST:%[0-9]+]]>    = SCALAR-STEPS vp<[[IV]]>, ir<1>, vp<[[VF]]>58; NO-VP-NEXT:    CLONE ir<[[GEP1:%.+]]> = getelementptr inbounds ir<%b>, vp<[[ST]]>59; NO-VP-NEXT:    vp<[[PTR1:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP1]]>60; NO-VP-NEXT:    WIDEN ir<[[LD1:%.+]]> = load vp<[[PTR1]]>61; NO-VP-NEXT:    CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%c>, vp<[[ST]]>62; NO-VP-NEXT:    vp<[[PTR2:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP2]]>63; NO-VP-NEXT:    WIDEN ir<[[LD2:%.+]]> = load vp<[[PTR2]]>64; NO-VP-NEXT:    WIDEN ir<[[ADD:%.+]]> = add nsw ir<[[LD2]]>, ir<[[LD1]]>65; NO-VP-NEXT:    CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>66; NO-VP-NEXT:    vp<[[PTR3:%[0-9]+]]> = vector-pointer inbounds ir<[[GEP3]]>67; NO-VP-NEXT:    WIDEN store vp<[[PTR3]]>, ir<[[ADD]]>68; NO-VP-NEXT:    EMIT vp<[[IV_NEXT:%.+]]> = add nuw vp<[[IV]]>, vp<[[VFUF]]>69; NO-VP-NEXT:    EMIT branch-on-count  vp<[[IV_NEXT]]>, vp<[[VTC]]>70; NO-VP-NEXT:  No successors71; NO-VP-NEXT: }72 73entry:74  br label %for.body75 76for.body:77  %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]78  %arrayidx = getelementptr inbounds i32, ptr %b, i64 %iv79  %0 = load i32, ptr %arrayidx, align 480  %arrayidx2 = getelementptr inbounds i32, ptr %c, i64 %iv81  %1 = load i32, ptr %arrayidx2, align 482  %add = add nsw i32 %1, %083  %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %iv84  store i32 %add, ptr %arrayidx4, align 485  %iv.next = add nuw nsw i64 %iv, 186  %exitcond.not = icmp eq i64 %iv.next, %N87  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body88 89for.cond.cleanup:90  ret void91}92