[llvm] [AArch64][GlobalISel] Add G_FPEXT(G_FCONSTANT) folding (PR #160902)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 02:01:49 PDT 2025


================
@@ -678,8 +678,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
       .widenScalarToNextPow2(0)
       .clampScalar(0, s8, s64);
   getActionDefinitionsBuilder(G_FCONSTANT)
-      .legalFor({s32, s64, s128})
-      .legalFor(HasFP16, {s16})
+      // Always legalize S16 to prevent G_FCONSTANT being widened to G_CONSTANT
+      .legalFor({s16, s32, s64, s128})
----------------
davemgreen wrote:

Can you split this into a separate commit? I think we will want to favour gpr in more cases than we do at the moment.

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


More information about the llvm-commits mailing list