[llvm] [RISCV] Fold vector shift of sext/zext to widening multiply (PR #121563)
Piotr Fusik via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 06:05:18 PST 2025
================
@@ -654,15 +670,17 @@ define <16 x i16> @vwsll_vx_i8_v16i16_zext(<16 x i8> %a, i8 %b) {
define <16 x i16> @vwsll_vi_v16i16(<16 x i8> %a) {
; CHECK-LABEL: vwsll_vi_v16i16:
; CHECK: # %bb.0:
-; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
-; CHECK-NEXT: vzext.vf2 v10, v8
-; CHECK-NEXT: vsll.vi v8, v10, 2
+; CHECK-NEXT: li a0, 4
+; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
+; CHECK-NEXT: vwmulu.vx v10, v8, a0
+; CHECK-NEXT: vmv2r.v v8, v10
; CHECK-NEXT: ret
;
; CHECK-ZVBB-LABEL: vwsll_vi_v16i16:
; CHECK-ZVBB: # %bb.0:
+; CHECK-ZVBB-NEXT: li a0, 4
; CHECK-ZVBB-NEXT: vsetivli zero, 16, e8, m1, ta, ma
-; CHECK-ZVBB-NEXT: vwsll.vi v10, v8, 2
+; CHECK-ZVBB-NEXT: vwmulu.vx v10, v8, a0
----------------
pfusik wrote:
Fixed by delaying this transform.
https://github.com/llvm/llvm-project/pull/121563
More information about the llvm-commits
mailing list