[llvm] [RISCV][TTI] Return invalid for getCastInstrCost w/vector split. (PR #221913)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 23:18:57 PDT 2026


================
@@ -1925,6 +1931,12 @@ InstructionCost RISCVTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
   std::pair<InstructionCost, MVT> SrcLT = getTypeLegalizationCost(Src);
   std::pair<InstructionCost, MVT> DstLT = getTypeLegalizationCost(Dst);
 
+  // Currently VLOptimizer cannot inference the VL properly when vector splits.
+  // TODO: Remove this constraint when VLOptimizer can optimize this.
+  if (isa<ScalableVectorType>(Dst) && DstLT.first > 1 &&
----------------
lukel97 wrote:

I think only handling cast instructions is fine, since we will always need a cast instruction in the VPlan to end up with these wide types that need splitting. 

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


More information about the llvm-commits mailing list