[llvm] [RISCV][CostModel] Updates reduction and shuffle cost (PR #77342)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 13:00:18 PST 2024


================
@@ -531,9 +529,12 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
     if (LT.second.isFixedLengthVector())
       // vrsub.vi has a 5 bit immediate field, otherwise an li suffices
       LenCost = isInt<5>(LT.second.getVectorNumElements() - 1) ? 0 : 1;
-    // FIXME: replace the constant `2` below with cost of {VID_V,VRSUB_VX}
+    unsigned Opcodes[] = {RISCV::VID_V, RISCV::VRSUB_VX, RISCV : VRGATHER_VV};
----------------
preames wrote:

"ISCV : VRGATHER_VV" - Does this build?  Shouldn't there be a second :?

The cost sequence here is now ignoring the LI for the VX case.

Please, don't change LenCost.  It's correct.  Adjust only the other bits to make your fix.  

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


More information about the llvm-commits mailing list