[llvm] [AMDGPU] Allocate AVRegClass last (PR #146606)
Jeffrey Byrnes via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 15:47:44 PDT 2025
================
@@ -1,4 +1,4 @@
-# RUN: not llc -mtriple=amdgcn -mcpu=gfx908 -verify-machineinstrs -start-before=greedy,1 -stop-after=virtregrewriter,2 %s -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
+# RUN: not llc -mtriple=amdgcn -mcpu=gfx908 -start-before=greedy,1 -stop-after=virtregrewriter,2 %s -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
----------------
jrbyrnes wrote:
I've disabled the verifier on this and a couple other tests. It seems that the changes to allocation have triggered a latent issue. If RA fails and we enter error state, then we call `cleanupFailedVReg` to do some sort of rewrite + liveness workaround. This adds some undefs to split the live range of the problematic vreg and assignments. The effect of this it to put the regunit LiveRanges in a weird state that is inconsistent with other RA structures. I'm seeing that we insert a spill of a PhysReg at a point where the RegUnit LiveRange thinks it is already dead -- the RegUnit LiveRange doesn't model the liveness of this and the verifier complains. I'll keep looking into it for a bit, but since 1. it is independent of this PR, 2. it is very contrived and not experienced in internal tests, and 3. it is not the original error of the test case, I think it may make sense to address separately.
See also:
regalloc-illegal-eviction-assert.ll
register-killed-error-after-alloc-failure1.ll
https://github.com/llvm/llvm-project/pull/146606
More information about the llvm-commits
mailing list