[llvm] [Analysis][SVE] Improve cost model for some extending masked loads (PR #65957)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 02:20:25 PDT 2023


================
@@ -2461,6 +2461,34 @@ InstructionCost AArch64TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
             FP16Tbl, ISD, DstTy.getSimpleVT(), SrcTy.getSimpleVT()))
       return AdjustCost(Entry->Cost);
 
+  if ((ISD == ISD::ZERO_EXTEND || ISD == ISD::SIGN_EXTEND) &&
+      CCH == TTI::CastContextHint::Masked && ST->hasSVEorSME() &&
----------------
sdesmalen-arm wrote:

Is this change actually specific to masked loads/stores? The legalizer will just promote the types to a legal type and then do the splitting. I would think that the type promotion comes for free with most operations, not only the masked load/store, so you can just as well add these rows to the table on line 2407?

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


More information about the llvm-commits mailing list