[llvm] [X86] Improve llvm.get.active.lane.mask codegen (PR #225832)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 00:38:16 PDT 2026
================
@@ -32768,6 +32768,25 @@ X86TargetLowering::shouldExpandAtomicLoadInIR(LoadInst *LI) const {
: AtomicExpansionKind::None;
}
+bool X86TargetLowering::shouldExpandGetActiveLaneMaskUsingScalar(EVT VT) const {
+ if (!VT.isFixedLengthVector())
+ return false;
+
+ unsigned NumElts = VT.getVectorNumElements();
+
+ // Only consider power-of-2 vector lengths up to 64.
+ if (NumElts > 64 || !isPowerOf2_32(NumElts))
+ return false;
+
+ // AVX-512 natively supports mask registers (kmov/bzhi) for >=16.
+ if (Subtarget.hasAVX512())
+ return NumElts >= 16;
----------------
Andarwinux wrote:
Why is NumElts < 16 unsupported?
https://github.com/llvm/llvm-project/pull/225832
More information about the llvm-commits
mailing list