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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 03:21:07 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})
----------------
arsenm wrote:

Yes. We probably should enforce this somehow. We have an implicit notion of legal types, which we would be better off if we formalized and had the machine verifier enforce.  It's certainly weaker than the DAG case, but we do need to guarantee a set of properties to ensure the legalizer can complete 

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


More information about the llvm-commits mailing list