[all-commits] [llvm/llvm-project] 6307b4: [AMDGPU] Add `GCNRPTarget` to track register press...

Lucas Ramirez via All-commits all-commits at lists.llvm.org
Thu Jun 26 04:11:42 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6307b496f8ba35e8921522d60cc1c9b5e1f6d899
      https://github.com/llvm/llvm-project/commit/6307b496f8ba35e8921522d60cc1c9b5e1f6d899
  Author: Lucas Ramirez <11032120+lucas-rami at users.noreply.github.com>
  Date:   2025-06-26 (Thu, 26 Jun 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
    M llvm/lib/Target/AMDGPU/GCNRegPressure.h
    M llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
    M llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats-attr.mir

  Log Message:
  -----------
  [AMDGPU] Add `GCNRPTarget` to track register pressure against a target  (#145765)

This adds the `GCNRPTarget` class which models a register pressure
target (i.e., maximum number of SGPRs/VGPRS) that one can track register
savings against. The only current use of this class is in the
scheduler's rematerialization stage. It replaces the more ad-hoc (and
now deleted) `ExcessRP` class which used to serve the same purpose.

This is only NFC~ish because `GCNRPTarget` tracks VGPR usage more
accurately than `ExcessRP` used to. To estimate required combined VGPR
savings we now additionally take into account the number of available
VGPRs in both banks (ArchVGPR and AGPR) at the time where the RP target
is created, whereas we used to only consider explicit savings made from
the starting RP. This makes VGPR savings estimations more accurate in
cases where we allow for savings in one VGPR bank to help towards
reducing pressure in another VGPR bank (see
`GCNRPTarget::CombineVGPRSavings`). This is the cause for unit test
changes.



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