[llvm] [CodeGen] Recompute intervals after erasing subregister IMPLICIT_DEF (PR #218348)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 02:25:01 PDT 2026


Karl =?utf-8?q?Hylén?= <karl.hylen at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/218348 at github.com>


================
@@ -0,0 +1,87 @@
+# RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass=register-coalescer \
+# RUN:   -enable-subreg-liveness -verify-coalescing -o - %s | \
+# RUN:   FileCheck %s --check-prefix=COALESCER
+# RUN: llc -mtriple=x86_64-unknown-linux-gnu \
+# RUN:   --passes='register-coalescer,print<live-intervals>' \
+# RUN:   -enable-subreg-liveness -verify-coalescing -o /dev/null %s 2>&1 | \
+# RUN:   FileCheck %s --check-prefix=INTERVALS
+# RUN: llc -mtriple=x86_64-unknown-linux-gnu \
+# RUN:   -run-pass=register-coalescer,greedy,virtregrewriter \
+# RUN:   -enable-subreg-liveness -verify-coalescing -verify-regalloc \
+# RUN:   -verify-machineinstrs -o - %s | FileCheck %s --check-prefix=REGALLOC
+
+# Erasing the high-byte IMPLICIT_DEF while coalescing makes the high-byte value
+# from bb.1 reach the use in bb.5 along the bb.3 edge. Recompute the coalesced
+# interval so it reflects that change. The low-byte use in bb.3 keeps the other
+# lane live, so both lanes must be live into bb.3 during register allocation.
+# The high-byte interval check covers its definition in bb.1 through the end of
+# bb.3.
+
+# COALESCER-LABEL: name: recompute_after_subreg_implicit_def
+# COALESCER: bb.3:
+# COALESCER-NOT: IMPLICIT_DEF
----------------
arsenm wrote:

Avoid relying on -NOT checks, especially since there's talk of renaming IMPLICIT_DEF 

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


More information about the llvm-commits mailing list