[llvm] [RISCV][CostModel] Make VMV_S_* and VMV_*_S cost independent of LMUL (PR #78739)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 07:35:50 PST 2024


================
@@ -475,10 +481,9 @@ InstructionCost RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind,
 
       return LT.first *
              (TLI->getLMULCost(LT.second) + // FIXME: this should be 1 for andi
-              TLI->getLMULCost(
-                  LT.second) + // FIXME: vmv.x.s is the same as extractelement
               getRISCVInstructionCost({RISCV::VMV_V_I, RISCV::VMERGE_VIM,
-                                       RISCV::VMV_V_X, RISCV::VMSNE_VI},
----------------
preames wrote:

Hm, one thing I'm noticing.  I think the example code sequence above is only for short fixed vectors.  For that to work on scalable vectors, I think we need a slide in there somewhere.  Or, said alternatively, that remaining LMUL scaling is probably modeling the vslidedown more than the andi for scalable vectors and we need to adjust our example and comments slightly.  

(Not directly relevant to your change, more the existing code structure.)

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


More information about the llvm-commits mailing list