[llvm] [RISCV][VLOPT] Add support for checkUsers when UserMI is a Single-Width Integer Reduction (PR #120345)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 06:24:50 PST 2025


================
@@ -149,8 +152,11 @@ define i32 @mul_i32(<4 x i32> %a, <4 x i32> %b) {
 ; RV64-NEXT:    vslidedown.vi v10, v9, 2
 ; RV64-NEXT:    vmul.vv v9, v9, v10
 ; RV64-NEXT:    vrgather.vi v10, v8, 1
+; RV64-NEXT:    vsetivli zero, 1, e32, m1, ta, ma
 ; RV64-NEXT:    vmul.vv v8, v8, v10
+; RV64-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
 ; RV64-NEXT:    vrgather.vi v10, v9, 1
+; RV64-NEXT:    vsetivli zero, 1, e32, m1, ta, ma
----------------
michaelmaitland wrote:

> I'm not seeing any diffs related to vmv.x.s in this patch that aren't regressions and I'm not sure how they're needed for the reductions.

Prior to this patch, `isVectorOpUsedAsScalarOp` was missing support for vmv.x.s. This was a bug. We'd be reducing them incorrectly if we didn't add it to isVectorOpUsedAsScalarOp.

https://github.com/llvm/llvm-project/pull/120345


More information about the llvm-commits mailing list