[llvm] [GlobalISel] Add support for scalarizing vector insert and extract elements (PR #153274)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 03:34:34 PDT 2025


================
@@ -1146,7 +1146,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
       .clampMaxNumElements(1, s32, 4)
       .clampMaxNumElements(1, s16, 8)
       .clampMaxNumElements(1, s8, 16)
-      .clampMaxNumElements(1, p0, 2);
+      .clampMaxNumElements(1, p0, 2)
+      .scalarizeIf(scalarOrEltWiderThan(1, 64), 1);
----------------
davemgreen wrote:

I think my preference would be to keep being explicit with the type. We wouldn't want other types (like scalable vectors in the future) to randomly try to scalarize because we hadn't been more specific. Falling off the end and marking them as unsupported is probably better.

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


More information about the llvm-commits mailing list