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

Matt Arsenault via All-commits all-commits at lists.llvm.org
Sun Feb 23 22:21:48 PST 2025


  Branch: refs/heads/users/arsenm/regalloc/fix-assert-after-ra-failure
  Home:   https://github.com/llvm/llvm-project
  Commit: 399d5d603c7127e8480b665860cc0a8073e0a503
      https://github.com/llvm/llvm-project/commit/399d5d603c7127e8480b665860cc0a8073e0a503
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-24 (Mon, 24 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.



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