[llvm] [AArch64] Lower masked.expandload intrinsic using SVE2p2/SME2p2 EXPAND (PR #190999)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 05:21:49 PDT 2026


================
@@ -4904,6 +4905,10 @@ AArch64TTIImpl::getMaskedMemoryOpCost(const MemIntrinsicCostAttributes &MICA,
   if (VT->getElementCount() == ElementCount::getScalable(1))
     return InstructionCost::getInvalid();
 
+  if (MICA.getID() == Intrinsic::masked_expandload &&
+      !isLegalMaskedExpandLoad(Src, MICA.getAlignment()))
+    return InstructionCost::getInvalid();
----------------
paulwalker-arm wrote:

Perhaps:
```suggestion
  if (MICA.getID() == Intrinsic::masked_expandload) {
    if (!isLegalMaskedExpandLoad(Src, MICA.getAlignment()))
      return InstructionCost::getInvalid();
      
    // Operation will be split into expand of masked.load.
    return LT.first * 2;
  }
```
This still omits the cost of constructing the mask but is a more realistic starting point that we can build on later if need be.

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


More information about the llvm-commits mailing list