[llvm] [AArch64] Tighten conditions for expanding GET_ACTIVE_LANE_MASK (PR #208962)

Usman Nadeem via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 14:49:26 PDT 2026


================
@@ -2447,10 +2449,9 @@ bool AArch64TargetLowering::shouldExpandGetActiveLaneMask(EVT ResVT,
       ResVT.getVectorElementType() != MVT::i1)
     return true;
 
-  // Only support illegal types if the result is scalable and min elements > 1.
-  if (ResVT.getVectorMinNumElements() == 1 ||
-      (ResVT.isFixedLengthVector() && (ResVT.getVectorNumElements() > 16 ||
-                                       (OpVT != MVT::i32 && OpVT != MVT::i64))))
+  // Only support illegal types if the result is scalable.
+  if ((ResVT.isFixedLengthVector() && (ResVT.getVectorNumElements() > 16 ||
+                                       ResVT.getVectorNumElements() == 1)))
----------------
UsmanNadeem wrote:

I have gone ahead and added tests for `v32i1` and `v1i1`. `v1i1` is the only thing not expanded now, and it looks like the codegen for >16 elements is also decent.

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


More information about the llvm-commits mailing list