[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 8 09:54:24 PDT 2026


================
@@ -7439,14 +7368,50 @@ SDValue AArch64TargetLowering::LowerMLOAD(SDValue Op, SelectionDAG &DAG) const {
   if (PassThru->isUndef() || isZerosVector(PassThru.getNode()))
     return Op;
 
+  if (!LoadNode->isExpandingLoad()) {
+    SDValue Load = DAG.getMaskedLoad(
+        VT, DL, LoadNode->getChain(), LoadNode->getBasePtr(),
+        LoadNode->getOffset(), Mask, DAG.getUNDEF(VT), LoadNode->getMemoryVT(),
+        LoadNode->getMemOperand(), LoadNode->getAddressingMode(),
+        LoadNode->getExtensionType());
+
+    SDValue Result = DAG.getSelect(DL, VT, Mask, Load, PassThru);
+    return DAG.getMergeValues({Result, Load.getValue(1)}, DL);
+  }
+
+  // Expand instruction is available with SVE2p2 in streaming mode only
+  // if SMEFA64 is available. Expand is always available with SME2p2.
+  if (!(Subtarget->hasSVE2p2() &&
+        (!Subtarget->isStreaming() || Subtarget->hasSMEFA64())) &&
+      !Subtarget->hasSME2p2())
+    return Op;
----------------
paulwalker-arm wrote:

For context, I'm trying to maintain the idiom `for this operating environment` I need `these features`. 

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


More information about the llvm-commits mailing list