[all-commits] [llvm/llvm-project] 6f5439: RegisterCoalescer: Do not introduce uses of empty ...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Thu Oct 9 20:19:47 PDT 2025


  Branch: refs/heads/users/arsenm/register-coalescer/avoid-using-regclasses-no-registers
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f5439979f291c09ea489a6527e044b80bb9d3ba
      https://github.com/llvm/llvm-project/commit/6f5439979f291c09ea489a6527e044b80bb9d3ba
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-10-10 (Fri, 10 Oct 2025)

  Changed paths:
    M llvm/lib/CodeGen/RegisterCoalescer.cpp
    A llvm/test/CodeGen/AMDGPU/coalescer-avoid-coalesce-class-with-no-registers.ll
    A llvm/test/CodeGen/AMDGPU/coalescer-avoid-coalesce-class-with-no-registers.mir

  Log Message:
  -----------
  RegisterCoalescer: Do not introduce uses of empty register classes

Check RegisterClassInfo if any registers of the new class are
actually available for use. Currently AMDGPU overrides shouldCoalesce
to avoid this situation. The target hook does not have access to the
dynamic register class counts, but ideally the target hook would
only be used for profitability concerns.

The new test doesn't change, due to the AMDGPU shouldCoalesce override,
but would be unallocatable if we dropped the override and switched
to the default implementation. The existing limit-coalesce.mir already
tests the behavior of this override, but it's too conservative and
isn't checking the case where the new class is unallocatable. Add
this check so it can be relaxed.



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