[all-commits] [llvm/llvm-project] c12b36: RegAlloc: Use new approach to handling failed allo...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Feb 26 00:32:22 PST 2025


  Branch: refs/heads/users/arsenm/regalloc/fix-assert-after-ra-failure
  Home:   https://github.com/llvm/llvm-project
  Commit: c12b3638f7ed512ca991f07c31e60726c1df5781
      https://github.com/llvm/llvm-project/commit/c12b3638f7ed512ca991f07c31e60726c1df5781
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-26 (Wed, 26 Feb 2025)

  Changed paths:
    M llvm/lib/CodeGen/RegAllocBase.cpp
    M llvm/lib/CodeGen/RegAllocBase.h
    M llvm/lib/CodeGen/RegAllocBasic.cpp
    M llvm/lib/CodeGen/RegAllocGreedy.cpp
    M llvm/lib/CodeGen/VirtRegMap.cpp
    A llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers-assertion-after-ra-failure.ll
    R llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers-assertion-after-ra-failure.xfail.ll
    M llvm/test/CodeGen/AMDGPU/illegal-eviction-assert.mir
    M llvm/test/CodeGen/AMDGPU/inflated-reg-class-snippet-copy-use-after-free.mir
    M llvm/test/CodeGen/AMDGPU/issue48473.mir
    M llvm/test/CodeGen/AMDGPU/register-killed-error-after-alloc-failure0.mir

  Log Message:
  -----------
  RegAlloc: Use new approach to handling failed allocations

This fixes an assert after allocation failure.

Rather than collecting failed virtual registers and hacking
on the uses after the fact, directly hack on the uses and rewrite
the registers to the dummy assignment immediately.

Previously we were bypassing LiveRegMatrix and directly assigning
in the VirtRegMap. This resulted in inconsistencies where illegal
overlapping assignments were missing. Rather than try to hack in
some system to manage these in LiveRegMatrix (i.e. hacking around
cases with invalid iterators), avoid this by directly using the
physreg. This should also allow removal of special casing in
virtregrewriter for failed allocations.


  Commit: 7fc5079fd7059c5595137042847cd6558249861d
      https://github.com/llvm/llvm-project/commit/7fc5079fd7059c5595137042847cd6558249861d
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-26 (Wed, 26 Feb 2025)

  Changed paths:
    M llvm/lib/CodeGen/VirtRegMap.cpp
    M llvm/test/CodeGen/AMDGPU/illegal-eviction-assert.mir
    M llvm/test/CodeGen/AMDGPU/issue48473.mir
    M llvm/test/CodeGen/AMDGPU/register-killed-error-after-alloc-failure0.mir

  Log Message:
  -----------
  Remove special casing in VirtRegRewriter

We could now delete FailedRegAlloc since the special case
handling is now local to the allocation passes. We're still using
it to avoid repeated errors, so that would need some new local state.


Compare: https://github.com/llvm/llvm-project/compare/6af25a4e2bc6...7fc5079fd705

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list