| ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost of .*: EMIT vp<.*> = first-order splice" --version 6 |
| ; RUN: opt < %s -passes=loop-vectorize -disable-output -debug-only=loop-vectorize 2>&1 | FileCheck %s |
| ; REQUIRES: asserts |
| target triple = "aarch64" |
| |
| define void @foo(ptr noalias %in, ptr noalias %out, i64 %n) "target-features"="+sve" { |
| ; CHECK-LABEL: 'foo' |
| ; CHECK: Cost of 1 for VF 2: EMIT vp<[[VP6:%[0-9]+]]> = first-order splice ir<%prev>, ir<%cur> |
| ; CHECK: Cost of Invalid for VF vscale x 1: EMIT vp<[[VP6]]> = first-order splice ir<%prev>, ir<%cur> |
| ; CHECK: Cost of 3 for VF vscale x 2: EMIT vp<[[VP6]]> = first-order splice ir<%prev>, ir<%cur> |
| ; |
| entry: |
| %prev.init = load i64, ptr %in, align 8 |
| br label %for.body |
| |
| for.body: |
| %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ] |
| %prev = phi i64 [ %prev.init, %entry ], [ %cur, %for.body ] |
| %iv.next = add nuw nsw i64 %iv, 1 |
| %cur.idx = getelementptr inbounds nuw i64, ptr %in, i64 %iv.next |
| %cur = load i64, ptr %cur.idx |
| %add = add i64 %cur, %prev |
| %store.idx = getelementptr inbounds nuw i64, ptr %out, i64 %iv |
| store i64 %add, ptr %store.idx |
| %exitcond.not = icmp eq i64 %iv.next, %n |
| br i1 %exitcond.not, label %exit, label %for.body |
| |
| exit: |
| ret void |
| } |