[llvm] [RegAlloc] Avoid split past block-prologue interference (PR #209704)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 02:52:47 PDT 2026


================
@@ -0,0 +1,107 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=greedy -o - %s | FileCheck %s
+
+# Check that splitting doesn't attempt to split after the prologue, if the first
+# interference is in the prologue. The hot loop in bb.1 keeps %0 in $vgpr0.
+# On the cold exit, the pre-existing WWM_COPY in bb.2 is a block prologue and
+# also occupies $vgpr0. Therefore, we can't split in bb.2. In this case,
+# spilling is chosen instead.
+# This is a regression test for the SplitKit interference assertion in 
+# 'leaveIntvAtTop'.
+#
+--- |
+  define amdgpu_kernel void @wwm_copy_prologue_assert() #0 {
+    ret void
+  }
+
+  attributes #0 = { "amdgpu-num-vgpr"="2" }
----------------
arsenm wrote:

Don't introduce new uses of this attribute. Does -stress-regalloc work just as well?

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


More information about the llvm-commits mailing list