[llvm] [LV] Regen RISC-V vp-intrinics test with UTC (NFC) (PR #221145)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 3 23:39:38 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Ramkumar Ramachandra (artagnon)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/221145.diff
1 Files Affected:
- (modified) llvm/test/Transforms/LoopVectorize/VPlan/RISCV/vplan-vp-intrinsics.ll (+140-91)
``````````diff
diff --git a/llvm/test/Transforms/LoopVectorize/VPlan/RISCV/vplan-vp-intrinsics.ll b/llvm/test/Transforms/LoopVectorize/VPlan/RISCV/vplan-vp-intrinsics.ll
index c3fc061affb55..e2ab868cd3366 100644
--- a/llvm/test/Transforms/LoopVectorize/VPlan/RISCV/vplan-vp-intrinsics.ll
+++ b/llvm/test/Transforms/LoopVectorize/VPlan/RISCV/vplan-vp-intrinsics.ll
@@ -1,78 +1,90 @@
-; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
-; RUN: -tail-folding-policy=prefer-fold-tail \
-; RUN: -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -disable-output < %s 2>&1 | FileCheck --check-prefixes=IF-EVL,CHECK %s
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter-out-after "middle.block" --version 6
+; RUN: opt -passes=loop-vectorize -vplan-print-after=printOptimizedVPlan at 2 \
+; RUN: -tail-folding-policy=prefer-fold-tail -mtriple=riscv64 -mattr=+v \
+; RUN: -riscv-v-vector-bits-max=128 -disable-output %s 2>&1 \
+; RUN: | FileCheck --check-prefix=IF-EVL %s
-; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
-; RUN: -tail-folding-policy=dont-fold-tail \
-; RUN: -mtriple=riscv64 -mattr=+v -riscv-v-vector-bits-max=128 -disable-output < %s 2>&1 | FileCheck --check-prefixes=NO-VP,CHECK %s
+; RUN: opt -passes=loop-vectorize -vplan-print-after=printOptimizedVPlan at 2 \
+; RUN: -tail-folding-policy=dont-fold-tail -mtriple=riscv64 -mattr=+v \
+; RUN: -riscv-v-vector-bits-max=128 -disable-output %s 2>&1 \
+; RUN: | FileCheck --check-prefix=NO-VP %s
define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {
-; IF-EVL: VPlan 'Initial VPlan for VF={1},UF>=1'
-; IF-EVL-NOT: CURRENT-ITERATION-PHI
-;
-; IF-EVL: VPlan 'Initial VPlan for VF={vscale x 1,vscale x 2,vscale x 4},UF={1}' {
-; IF-EVL-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF
-; IF-EVL-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count
-; IF-EVL-NEXT: Live-in ir<%N> = original trip-count
+; IF-EVL-LABEL: VPlan for loop in 'foo'
+; IF-EVL: VPlan 'Initial VPlan for VF={vscale x 1,vscale x 2,vscale x 4},UF={1}' {
+; IF-EVL-NEXT: Live-in vp<[[VP0:%[0-9]+]]> = VF * UF
+; IF-EVL-NEXT: Live-in vp<[[VP1:%[0-9]+]]> = vector-trip-count
+; IF-EVL-NEXT: Live-in ir<%N> = original trip-count
; IF-EVL-EMPTY:
-; IF-EVL: vector.ph:
-; IF-EVL-NEXT: Successor(s): vector loop
+; IF-EVL-NEXT: ir-bb<entry>:
+; IF-EVL-NEXT: Successor(s): scalar.ph, vector.ph
; IF-EVL-EMPTY:
-; IF-EVL-NEXT: <x1> vector loop: {
-; IF-EVL-NEXT: vp<[[IV:%[0-9]+]]> = CANONICAL-IV
+; IF-EVL-NEXT: vector.ph:
+; IF-EVL-NEXT: Successor(s): vector loop
; IF-EVL-EMPTY:
-; IF-EVL-NEXT: vector.body:
-; IF-EVL-NEXT: CURRENT-ITERATION-PHI vp<[[EVL_PHI:%[0-9]+]]> = phi ir<0>, vp<[[IV_NEXT:%.+]]>
-; IF-EVL-NEXT: EMIT-SCALAR vp<[[AVL:%.+]]> = phi [ ir<%N>, vector.ph ], [ vp<[[AVL_NEXT:%.+]]>, vector.body ]
-; IF-EVL-NEXT: EMIT-SCALAR vp<%evl> = EXPLICIT-VECTOR-LENGTH vp<[[AVL]]>
-; IF-EVL-NEXT: EMIT-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<%evl> to i64
-; IF-EVL-NEXT: vp<[[ST:%[0-9]+]]> = SCALAR-STEPS vp<[[EVL_PHI]]>, ir<1>, vp<[[CAST]]>
-; IF-EVL-NEXT: CLONE ir<[[GEP1:%.+]]> = getelementptr inbounds ir<%b>, vp<[[ST]]>
-; IF-EVL-NEXT: vp<[[PTR1:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP1]]>
-; IF-EVL-NEXT: WIDEN ir<[[LD1:%.+]]> = vp.load vp<[[PTR1]]>, vp<%evl>
-; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%c>, vp<[[ST]]>
-; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP2]]>
-; IF-EVL-NEXT: WIDEN ir<[[LD2:%.+]]> = vp.load vp<[[PTR2]]>, vp<%evl>
-; IF-EVL-NEXT: WIDEN ir<[[ADD:%.+]]> = add nsw ir<[[LD2]]>, ir<[[LD1]]>
-; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
-; IF-EVL-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP3]]>
-; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[ADD]]>, vp<%evl>
-; IF-EVL-NEXT: EMIT-SCALAR vp<[[CAST2:%[0-9]+]]> = zext vp<%evl> to i64
-; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST2]]>, vp<[[EVL_PHI]]>
-; IF-EVL-NEXT: EMIT vp<[[AVL_NEXT]]> = sub nuw vp<[[AVL]]>, vp<[[CAST2]]>
-; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
-; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
-; IF-EVL-NEXT: No successors
-; IF-EVL-NEXT: }
-
-; NO-VP: VPlan 'Initial VPlan for VF={vscale x 1,vscale x 2,vscale x 4},UF>=1' {
-; NO-VP-NEXT: Live-in vp<[[VF:%[0-9]+]]> = VF
-; NO-VP-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF
-; NO-VP-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count
-; NO-VP-NEXT: Live-in ir<%N> = original trip-count
+; IF-EVL-NEXT: <x1> vector loop: {
+; IF-EVL-NEXT: vp<[[VP2:%[0-9]+]]> = CANONICAL-IV
+; IF-EVL-EMPTY:
+; IF-EVL-NEXT: vector.body:
+; IF-EVL-NEXT: CURRENT-ITERATION-PHI vp<[[VP4:%[0-9]+]]> = phi ir<0>, vp<%current.iteration.next>
+; IF-EVL-NEXT: EMIT-SCALAR vp<%avl> = phi [ ir<%N>, vector.ph ], [ vp<%avl.next>, vector.body ]
+; IF-EVL-NEXT: EMIT-SCALAR vp<%evl> = EXPLICIT-VECTOR-LENGTH vp<%avl>
+; IF-EVL-NEXT: EMIT-SCALAR vp<[[VP5:%[0-9]+]]> = zext vp<%evl> to i64
+; IF-EVL-NEXT: vp<[[VP6:%[0-9]+]]> = SCALAR-STEPS vp<[[VP4]]>, ir<1>, vp<[[VP5]]>
+; IF-EVL-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%b>, vp<[[VP6]]>
+; IF-EVL-NEXT: vp<[[VP7:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx>, ir<1>
+; IF-EVL-NEXT: WIDEN ir<%0> = vp.load vp<[[VP7]]>, vp<%evl>
+; IF-EVL-NEXT: CLONE ir<%arrayidx2> = getelementptr inbounds ir<%c>, vp<[[VP6]]>
+; IF-EVL-NEXT: vp<[[VP8:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx2>, ir<1>
+; IF-EVL-NEXT: WIDEN ir<%1> = vp.load vp<[[VP8]]>, vp<%evl>
+; IF-EVL-NEXT: WIDEN ir<%add> = add nsw ir<%1>, ir<%0>
+; IF-EVL-NEXT: CLONE ir<%arrayidx4> = getelementptr inbounds ir<%a>, vp<[[VP6]]>
+; IF-EVL-NEXT: vp<[[VP9:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx4>, ir<1>
+; IF-EVL-NEXT: WIDEN vp.store vp<[[VP9]]>, ir<%add>, vp<%evl>
+; IF-EVL-NEXT: EMIT-SCALAR vp<[[VP10:%[0-9]+]]> = zext vp<%evl> to i64
+; IF-EVL-NEXT: EMIT vp<%current.iteration.next> = add vp<[[VP10]]>, vp<[[VP4]]>
+; IF-EVL-NEXT: EMIT vp<%avl.next> = sub nuw vp<%avl>, vp<[[VP10]]>
+; IF-EVL-NEXT: EMIT vp<%index.next> = add vp<[[VP2]]>, vp<[[VP0]]>
+; IF-EVL-NEXT: EMIT branch-on-count vp<%index.next>, vp<[[VP1]]>
+; IF-EVL-NEXT: No successors
+; IF-EVL-NEXT: }
+; IF-EVL-NEXT: Successor(s): middle.block
+;
+; NO-VP-LABEL: VPlan for loop in 'foo'
+; NO-VP: VPlan 'Initial VPlan for VF={2,4,8},UF>=1' {
+; NO-VP-NEXT: Live-in vp<[[VP0:%[0-9]+]]> = VF
+; NO-VP-NEXT: Live-in vp<[[VP1:%[0-9]+]]> = VF * UF
+; NO-VP-NEXT: Live-in vp<[[VP2:%[0-9]+]]> = vector-trip-count
+; NO-VP-NEXT: Live-in ir<%N> = original trip-count
+; NO-VP-EMPTY:
+; NO-VP-NEXT: ir-bb<entry>:
+; NO-VP-NEXT: Successor(s): scalar.ph, vector.ph
; NO-VP-EMPTY:
-; NO-VP: vector.ph:
-; NO-VP-NEXT: Successor(s): vector loop
+; NO-VP-NEXT: vector.ph:
+; NO-VP-NEXT: Successor(s): vector loop
; NO-VP-EMPTY:
-; NO-VP-NEXT: <x1> vector loop: {
-; NO-VP-NEXT: vp<[[IV:%[0-9]+]]> = CANONICAL-IV
+; NO-VP-NEXT: <x1> vector loop: {
+; NO-VP-NEXT: vp<[[VP3:%[0-9]+]]> = CANONICAL-IV
; NO-VP-EMPTY:
-; NO-VP-NEXT: vector.body:
-; NO-VP-NEXT: vp<[[ST:%[0-9]+]]> = SCALAR-STEPS vp<[[IV]]>, ir<1>, vp<[[VF]]>
-; NO-VP-NEXT: CLONE ir<[[GEP1:%.+]]> = getelementptr inbounds ir<%b>, vp<[[ST]]>
-; NO-VP-NEXT: vp<[[PTR1:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP1]]>
-; NO-VP-NEXT: WIDEN ir<[[LD1:%.+]]> = load vp<[[PTR1]]>
-; NO-VP-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%c>, vp<[[ST]]>
-; NO-VP-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP2]]>
-; NO-VP-NEXT: WIDEN ir<[[LD2:%.+]]> = load vp<[[PTR2]]>
-; NO-VP-NEXT: WIDEN ir<[[ADD:%.+]]> = add nsw ir<[[LD2]]>, ir<[[LD1]]>
-; NO-VP-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
-; NO-VP-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer inbounds i32, ir<[[GEP3]]>
-; NO-VP-NEXT: WIDEN store vp<[[PTR3]]>, ir<[[ADD]]>
-; NO-VP-NEXT: EMIT vp<[[IV_NEXT:%.+]]> = add nuw vp<[[IV]]>, vp<[[VFUF]]>
-; NO-VP-NEXT: EMIT branch-on-count vp<[[IV_NEXT]]>, vp<[[VTC]]>
-; NO-VP-NEXT: No successors
-; NO-VP-NEXT: }
+; NO-VP-NEXT: vector.body:
+; NO-VP-NEXT: vp<[[VP4:%[0-9]+]]> = SCALAR-STEPS vp<[[VP3]]>, ir<1>, vp<[[VP0]]>
+; NO-VP-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%b>, vp<[[VP4]]>
+; NO-VP-NEXT: vp<[[VP5:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx>, ir<1>
+; NO-VP-NEXT: WIDEN ir<%0> = load vp<[[VP5]]>
+; NO-VP-NEXT: CLONE ir<%arrayidx2> = getelementptr inbounds ir<%c>, vp<[[VP4]]>
+; NO-VP-NEXT: vp<[[VP6:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx2>, ir<1>
+; NO-VP-NEXT: WIDEN ir<%1> = load vp<[[VP6]]>
+; NO-VP-NEXT: WIDEN ir<%add> = add nsw ir<%1>, ir<%0>
+; NO-VP-NEXT: CLONE ir<%arrayidx4> = getelementptr inbounds ir<%a>, vp<[[VP4]]>
+; NO-VP-NEXT: vp<[[VP7:%[0-9]+]]> = vector-pointer inbounds i32, ir<%arrayidx4>, ir<1>
+; NO-VP-NEXT: WIDEN store vp<[[VP7]]>, ir<%add>
+; NO-VP-NEXT: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1]]>
+; NO-VP-NEXT: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; NO-VP-NEXT: No successors
+; NO-VP-NEXT: }
+; NO-VP-NEXT: Successor(s): middle.block
+;
+
entry:
br label %for.body
@@ -95,31 +107,68 @@ for.cond.cleanup:
}
define void @safe_dep(ptr %p) {
-; CHECK: VPlan 'Initial VPlan for VF={vscale x 1,vscale x 2},UF>=1' {
-; CHECK-NEXT: Live-in vp<[[VF:%[0-9]+]]> = VF
-; CHECK-NEXT: Live-in vp<[[VFUF:%[0-9]+]]> = VF * UF
-; CHECK-NEXT: Live-in vp<[[VTC:%[0-9]+]]> = vector-trip-count
-; CHECK-NEXT: Live-in ir<512> = original trip-count
-; CHECK-EMPTY:
-; CHECK: vector.ph:
-; CHECK-NEXT: Successor(s): vector loop
-; CHECK-EMPTY:
-; CHECK-NEXT: <x1> vector loop: {
-; CHECK-NEXT: vp<[[IV:%[0-9]+]]> = CANONICAL-IV
-; CHECK-EMPTY:
-; CHECK-NEXT: vector.body:
-; CHECK-NEXT: vp<[[ST:%[0-9]+]]> = SCALAR-STEPS vp<[[IV]]>, ir<1>, vp<[[VF]]>
-; CHECK-NEXT: CLONE ir<[[GEP1:%.+]]> = getelementptr ir<%p>, vp<[[ST]]>
-; CHECK-NEXT: vp<[[PTR1:%[0-9]+]]> = vector-pointer i64, ir<[[GEP1]]>
-; CHECK-NEXT: WIDEN ir<[[V:%.+]]> = load vp<[[PTR1]]>
-; CHECK-NEXT: CLONE ir<[[OFFSET:.+]]> = add vp<[[ST]]>, ir<100>
-; CHECK-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr ir<%p>, ir<[[OFFSET]]>
-; CHECK-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer i64, ir<[[GEP2]]>
-; CHECK-NEXT: WIDEN store vp<[[PTR2]]>, ir<[[V]]>
-; CHECK-NEXT: EMIT vp<[[IV_NEXT:%.+]]> = add nuw vp<[[IV]]>, vp<[[VFUF]]>
-; CHECK-NEXT: EMIT branch-on-count vp<[[IV_NEXT]]>, vp<[[VTC]]>
-; CHECK-NEXT: No successors
-; CHECK-NEXT: }
+; IF-EVL-LABEL: VPlan for loop in 'safe_dep'
+; IF-EVL: VPlan 'Initial VPlan for VF={2,4},UF>=1' {
+; IF-EVL-NEXT: Live-in vp<[[VP0:%[0-9]+]]> = VF
+; IF-EVL-NEXT: Live-in vp<[[VP1:%[0-9]+]]> = VF * UF
+; IF-EVL-NEXT: Live-in vp<[[VP2:%[0-9]+]]> = vector-trip-count
+; IF-EVL-NEXT: Live-in ir<512> = original trip-count
+; IF-EVL-EMPTY:
+; IF-EVL-NEXT: ir-bb<entry>:
+; IF-EVL-NEXT: Successor(s): scalar.ph, vector.ph
+; IF-EVL-EMPTY:
+; IF-EVL-NEXT: vector.ph:
+; IF-EVL-NEXT: Successor(s): vector loop
+; IF-EVL-EMPTY:
+; IF-EVL-NEXT: <x1> vector loop: {
+; IF-EVL-NEXT: vp<[[VP3:%[0-9]+]]> = CANONICAL-IV
+; IF-EVL-EMPTY:
+; IF-EVL-NEXT: vector.body:
+; IF-EVL-NEXT: vp<[[VP4:%[0-9]+]]> = SCALAR-STEPS vp<[[VP3]]>, ir<1>, vp<[[VP0]]>
+; IF-EVL-NEXT: CLONE ir<%a1> = getelementptr ir<%p>, vp<[[VP4]]>
+; IF-EVL-NEXT: vp<[[VP5:%[0-9]+]]> = vector-pointer i64, ir<%a1>, ir<1>
+; IF-EVL-NEXT: WIDEN ir<%v> = load vp<[[VP5]]>
+; IF-EVL-NEXT: CLONE ir<%offset> = add vp<[[VP4]]>, ir<100>
+; IF-EVL-NEXT: CLONE ir<%a2> = getelementptr ir<%p>, ir<%offset>
+; IF-EVL-NEXT: vp<[[VP6:%[0-9]+]]> = vector-pointer i64, ir<%a2>, ir<1>
+; IF-EVL-NEXT: WIDEN store vp<[[VP6]]>, ir<%v>
+; IF-EVL-NEXT: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1]]>
+; IF-EVL-NEXT: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; IF-EVL-NEXT: No successors
+; IF-EVL-NEXT: }
+; IF-EVL-NEXT: Successor(s): middle.block
+;
+; NO-VP-LABEL: VPlan for loop in 'safe_dep'
+; NO-VP: VPlan 'Initial VPlan for VF={2,4},UF>=1' {
+; NO-VP-NEXT: Live-in vp<[[VP0:%[0-9]+]]> = VF
+; NO-VP-NEXT: Live-in vp<[[VP1:%[0-9]+]]> = VF * UF
+; NO-VP-NEXT: Live-in vp<[[VP2:%[0-9]+]]> = vector-trip-count
+; NO-VP-NEXT: Live-in ir<512> = original trip-count
+; NO-VP-EMPTY:
+; NO-VP-NEXT: ir-bb<entry>:
+; NO-VP-NEXT: Successor(s): scalar.ph, vector.ph
+; NO-VP-EMPTY:
+; NO-VP-NEXT: vector.ph:
+; NO-VP-NEXT: Successor(s): vector loop
+; NO-VP-EMPTY:
+; NO-VP-NEXT: <x1> vector loop: {
+; NO-VP-NEXT: vp<[[VP3:%[0-9]+]]> = CANONICAL-IV
+; NO-VP-EMPTY:
+; NO-VP-NEXT: vector.body:
+; NO-VP-NEXT: vp<[[VP4:%[0-9]+]]> = SCALAR-STEPS vp<[[VP3]]>, ir<1>, vp<[[VP0]]>
+; NO-VP-NEXT: CLONE ir<%a1> = getelementptr ir<%p>, vp<[[VP4]]>
+; NO-VP-NEXT: vp<[[VP5:%[0-9]+]]> = vector-pointer i64, ir<%a1>, ir<1>
+; NO-VP-NEXT: WIDEN ir<%v> = load vp<[[VP5]]>
+; NO-VP-NEXT: CLONE ir<%offset> = add vp<[[VP4]]>, ir<100>
+; NO-VP-NEXT: CLONE ir<%a2> = getelementptr ir<%p>, ir<%offset>
+; NO-VP-NEXT: vp<[[VP6:%[0-9]+]]> = vector-pointer i64, ir<%a2>, ir<1>
+; NO-VP-NEXT: WIDEN store vp<[[VP6]]>, ir<%v>
+; NO-VP-NEXT: EMIT vp<%index.next> = add nuw vp<[[VP3]]>, vp<[[VP1]]>
+; NO-VP-NEXT: EMIT branch-on-count vp<%index.next>, vp<[[VP2]]>
+; NO-VP-NEXT: No successors
+; NO-VP-NEXT: }
+; NO-VP-NEXT: Successor(s): middle.block
+;
entry:
br label %loop
``````````
</details>
https://github.com/llvm/llvm-project/pull/221145
More information about the llvm-commits
mailing list