[llvm] [RISCV][CostModel] Correct the cost of some reductions (PR #118072)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 09:37:03 PST 2024


================
@@ -1470,27 +1470,27 @@ RISCVTTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
     llvm_unreachable("Unsupported intrinsic");
   case Intrinsic::smax:
     SplitOp = RISCV::VMAX_VV;
-    Opcodes = {RISCV::VMV_S_X, RISCV::VREDMAX_VS, RISCV::VMV_X_S};
+    Opcodes = {RISCV::VREDMAX_VS, RISCV::VMV_X_S};
----------------
lukel97 wrote:

Agreed, I had to look back up why this was the case. @LiqinWeng could you update the comment to mention that we reuse the source as the start value for these reductions?

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


More information about the llvm-commits mailing list