[llvm-branch-commits] [llvm] [2/3][AMDGPU] Physical register tracking in GCN trackers. (PR #184275)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 7 04:51:33 PDT 2026


================
@@ -335,12 +400,41 @@ class GCNRPTracker {
 
   LaneBitmask getLastUsedLanes(Register Reg, SlotIndex Pos) const;
 
+  // Check if a register unit is live at a given slot index per LIS.
+  bool isUnitLiveAt(MCRegUnit Unit, SlotIndex SI) const;
+
+  // Check if any register unit of Reg is not currently live in PhysLiveRegs.
+  bool isAnyRegUnitNotLive(MCRegister Reg) const;
+
+  // Reconstruct physical register pressure from PhysLiveRegs.Regs.
+  GCNRegPressure constructPhysRegPressure() const;
+
+  // Check if Reg has any killed units at the given slot index.
+  bool checkRegKilled(MCRegister Reg, SlotIndex SI) const;
+
+  // Check if Reg has any killed units and erase them from PhysLiveRegs.
+  bool eraseKilledUnits(MCRegister Reg, SlotIndex SI);
+
+  // Erase all live units of Reg from PhysLiveRegs.
+  // Returns true if any unit was live (and thus erased).
+  bool eraseAllLiveUnits(MCRegister Reg);
+
+  // Insert units of Reg into PhysLiveRegs if not already live.
+  // Returns true if any unit was newly inserted.
+  bool insertIfNotLive(MCRegister Reg);
+
 public:
+  // Enable physical register tracking only if both GCNTrackers and
+  // TrackPhysRegInTrackers are true.
+  void setPhysRegTracking();
+
   // reset tracker and set live register set to the specified value.
   void reset(const MachineRegisterInfo &MRInfo,
              const LiveRegSet &VirtLiveRegsSet);
+
   // live regs for the current state
   const decltype(VirtLiveRegs) &getLiveRegs() const { return VirtLiveRegs; }
+  const decltype(VirtLiveRegs) &getVirtLiveRegs() const { return VirtLiveRegs; }
----------------
macurtis-amd wrote:

Unused / unneeded?

https://github.com/llvm/llvm-project/pull/184275


More information about the llvm-branch-commits mailing list