[llvm] [X86][GISel] Add missing legalization for G_IMPLICIT_DEF (PR #161699)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 03:20:44 PDT 2025


================
@@ -91,7 +91,27 @@ X86LegalizerInfo::X86LegalizerInfo(const X86Subtarget &STI,
   // s128 = EXTEND (G_IMPLICIT_DEF s32/s64) -> s128 = G_IMPLICIT_DEF
   getActionDefinitionsBuilder(G_IMPLICIT_DEF)
       .legalFor({p0, s1, s8, s16, s32, s64})
-      .legalFor(Is64Bit, {s128});
+      .legalFor(Is64Bit, {s128})
+      .legalFor(HasSSE2, {v16s8, v8s16, v4s32, v2s64})
+      .legalFor(HasAVX, {v8s32, v4s64})
+      .legalFor(HasAVX2, {v32s8, v16s16, v8s32, v4s64})
----------------
bonsthie wrote:

I split them because AVX1 lacks 256-bit integer ops, but you’re right that for legalization we only care that the register types exist in the ISA.

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


More information about the llvm-commits mailing list