26 lines · plain
1; REQUIRES: asserts2; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize --disable-output \3; RUN: -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue \4; RUN: -mtriple=riscv64 -mattr=+v -S < %s 2>&1 | FileCheck %s5 6; CHECK: Cost of 2 for VF vscale x 4: WIDEN-INTRINSIC vp<%{{.+}}> = call llvm.vp.merge(ir<true>, ir<%add>, ir<%rdx>, vp<%{{.+}}>)7; CHECK: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %rdx = phi i32 [ %start, %entry ], [ %add, %loop ]8 9define i32 @add(ptr %a, i64 %n, i32 %start) {10entry:11 br label %loop12 13loop:14 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]15 %rdx = phi i32 [ %start, %entry ], [ %add, %loop ]16 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %iv17 %0 = load i32, ptr %arrayidx, align 418 %add = add nsw i32 %0, %rdx19 %iv.next = add nuw nsw i64 %iv, 120 %exitcond.not = icmp eq i64 %iv.next, %n21 br i1 %exitcond.not, label %exit, label %loop22 23exit:24 ret i32 %add25}26