[llvm] [AArch64] Add custom lowering of nxv32i1 get.active.lane.mask nodes (PR #141969)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 06:11:13 PDT 2025


================
@@ -27328,6 +27330,29 @@ void AArch64TargetLowering::ReplaceExtractSubVectorResults(
   Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, VT, Half));
 }
 
+void AArch64TargetLowering::ReplaceGetActiveLaneMaskResults(
+    SDNode *N, SmallVectorImpl<SDValue> &Results, SelectionDAG &DAG) const {
+  if (!Subtarget->hasSVE2p1())
+    return;
+
+  SDLoc DL(N);
+  SDValue Idx = N->getOperand(0);
+  SDValue TC = N->getOperand(1);
+  if (Idx.getValueType() != MVT::i64) {
+    Idx = DAG.getZExtOrTrunc(Idx, DL, MVT::i64);
+    TC = DAG.getZExtOrTrunc(TC, DL, MVT::i64);
+  }
+
+  SDValue ID =
----------------
david-arm wrote:

It's look like this code is expecting the result type to <vscale x 32 x i1>. Is it worth adding an assert for this?

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


More information about the llvm-commits mailing list