You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vl-opt.ll
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,26 @@ define <vscale x 4 x i32> @different_imm_vl_with_ta(<vscale x 4 x i32> %passthru
30
30
ret <vscale x 4 x i32> %w
31
31
}
32
32
33
+
define <vscale x 4 x i32> @vlmax_and_imm_vl_with_ta(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl1, iXLen %vl2) {
34
+
; NOVLOPT-LABEL: vlmax_and_imm_vl_with_ta:
35
+
; NOVLOPT: # %bb.0:
36
+
; NOVLOPT-NEXT: vsetvli a0, zero, e32, m2, ta, ma
37
+
; NOVLOPT-NEXT: vadd.vv v8, v10, v12
38
+
; NOVLOPT-NEXT: vsetivli zero, 4, e32, m2, ta, ma
39
+
; NOVLOPT-NEXT: vadd.vv v8, v8, v10
40
+
; NOVLOPT-NEXT: ret
41
+
;
42
+
; VLOPT-LABEL: vlmax_and_imm_vl_with_ta:
43
+
; VLOPT: # %bb.0:
44
+
; VLOPT-NEXT: vsetivli zero, 4, e32, m2, ta, ma
45
+
; VLOPT-NEXT: vadd.vv v8, v10, v12
46
+
; VLOPT-NEXT: vadd.vv v8, v8, v10
47
+
; VLOPT-NEXT: ret
48
+
%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 -1)
49
+
%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)
50
+
ret <vscale x 4 x i32> %w
51
+
}
52
+
33
53
; Not beneficial to propagate VL since VL is larger in the use side.
34
54
define <vscale x 4 x i32> @different_imm_vl_with_ta_larger_vl(<vscale x 4 x i32> %passthru, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b, iXLen %vl1, iXLen %vl2) {
0 commit comments