[llvm] [M68K][GlobalISel] Remove dependency on legal ruleset (PR #207614)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 14:45:16 PDT 2026


https://github.com/davemgreen created https://github.com/llvm/llvm-project/pull/207614

This fills in always legal rules, to remove the dependency on the legacy
ruleset. This is not guaranteed to be all the rules, just the ones that appear
in tests.

See #197308

>From 86ffd883ce04ad2e4923e82ccf9f544ad1006798 Mon Sep 17 00:00:00 2001
From: David Green <david.green at arm.com>
Date: Sun, 5 Jul 2026 22:45:06 +0100
Subject: [PATCH] [M68K][GlobalISel] Remove dependency on legal ruleset

This fills in always legal rules, to remove the dependency on the legacy
ruleset. This is not guaranteed to be all the rules, just the ones that appear
in tests.

See #197308
---
 llvm/lib/Target/M68k/GISel/M68kLegalizerInfo.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/lib/Target/M68k/GISel/M68kLegalizerInfo.cpp b/llvm/lib/Target/M68k/GISel/M68kLegalizerInfo.cpp
index 6e712c3825d50..d6f951c26acd4 100644
--- a/llvm/lib/Target/M68k/GISel/M68kLegalizerInfo.cpp
+++ b/llvm/lib/Target/M68k/GISel/M68kLegalizerInfo.cpp
@@ -47,4 +47,6 @@ M68kLegalizerInfo::M68kLegalizerInfo(const M68kSubtarget &ST) {
       .clampScalar(0, s8, s32);
 
   getActionDefinitionsBuilder(G_PTR_ADD).legalFor({{p0, s32}});
+
+  getActionDefinitionsBuilder(G_TRUNC).alwaysLegal();
 }



More information about the llvm-commits mailing list