[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,
 
----------------
preames wrote:

Off topic for the actual change, but I think we can improve the code sequence above.

One idea would be to use a scalar multiply to do the broadcast since we know the value will either be 0 or (int16)-1.
Another would be to use a vrgather.vi in place of the extract/splat sequence.  
Another would be to extract the full16 bit value, do the extract and splat in scalar, and insert a full 16 bit value back.

Not sure if you care about this case or not, I don't much.

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


More information about the llvm-commits mailing list