Skip to content

Commit 296dee6

Browse files
fixup! useful test case
1 parent 2a14cd1 commit 296dee6

File tree

3 files changed

+20
-322
lines changed

3 files changed

+20
-322
lines changed

llvm/test/CodeGen/RISCV/rvv/vl-opt.ll

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,3 @@ define <vscale x 4 x i32> @dont_optimize_tied_def(<vscale x 4 x i32> %a, <vscale
150150
ret <vscale x 4 x i32> %2
151151
}
152152

153-
define <vscale x 4 x i32> @same_vl_imm(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
154-
; CHECK-LABEL: same_vl_imm:
155-
; CHECK: # %bb.0:
156-
; CHECK-NEXT: vsetivli zero, 4, e32, m2, ta, ma
157-
; CHECK-NEXT: vadd.vv v8, v10, v12
158-
; CHECK-NEXT: vadd.vv v8, v8, v10
159-
; CHECK-NEXT: ret
160-
%v = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen 4)
161-
%w = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %v, <vscale x 4 x i32> %a, iXLen 4)
162-
ret <vscale x 4 x i32> %w
163-
}
164-
165-
define <vscale x 4 x i32> @same_vl_reg(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl) {
166-
; CHECK-LABEL: same_vl_reg:
167-
; CHECK: # %bb.0:
168-
; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
169-
; CHECK-NEXT: vadd.vv v8, v10, v12
170-
; CHECK-NEXT: vadd.vv v8, v8, v10
171-
; CHECK-NEXT: ret
172-
%v = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl)
173-
%w = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %v, <vscale x 4 x i32> %a, iXLen %vl)
174-
ret <vscale x 4 x i32> %w
175-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; RUN: llc -mtriple=riscv64 -mattr=+v -riscv-enable-vl-optimizer \
2+
; RUN: -verify-machineinstrs -debug-only=riscv-vl-optimizer -o - 2>&1 %s | FileCheck %s
3+
4+
; REQUIRES: asserts
5+
6+
define <vscale x 4 x i32> @same_vl_imm(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
7+
; CHECK: User VL is: 4
8+
; CHECK-NEXT: Abort due to CommonVL == VLOp, no point in reducing.
9+
%v = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, i64 4)
10+
%w = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %v, <vscale x 4 x i32> %a, i64 4)
11+
ret <vscale x 4 x i32> %w
12+
}
13+
14+
define <vscale x 4 x i32> @same_vl_reg(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, i64 %vl) {
15+
; CHECK: User VL is: %3:gprnox0
16+
; CHECK-NEXT: Abort due to CommonVL == VLOp, no point in reducing.
17+
%v = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, i64 %vl)
18+
%w = call <vscale x 4 x i32> @llvm.riscv.vadd.nxv4i32.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> %v, <vscale x 4 x i32> %a, i64 %vl)
19+
ret <vscale x 4 x i32> %w
20+
}

0 commit comments

Comments
 (0)