[llvm] [AMDGPU] Fix GCNUpwardRPTracker. (WIP) (PR #71186)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 06:32:13 PST 2023


================
@@ -149,24 +149,46 @@ class GCNUpwardRPTracker : public GCNRPTracker {
 public:
   GCNUpwardRPTracker(const LiveIntervals &LIS_) : GCNRPTracker(LIS_) {}
 
-  // reset tracker to the point just below MI
-  // filling live regs upon this point using LIS
-  void reset(const MachineInstr &MI, const LiveRegSet *LiveRegs = nullptr);
-
   // reset tracker and set live register set to the specified value.
   void reset(const MachineRegisterInfo &MRI_, const LiveRegSet &LiveRegs_);
 
   // reset tracker at the specified slot index.
-  void reset(const MachineRegisterInfo &MRI_, SlotIndex SI) {
-    reset(MRI_, llvm::getLiveRegs(SI, LIS, MRI_));
+  void reset(const MachineRegisterInfo &MRI, SlotIndex SI) {
+    reset(MRI, llvm::getLiveRegs(SI, LIS, MRI));
+  }
+
+  // reset tracker to the end of the MBB.
+  void reset(const MachineBasicBlock &MBB) {
+    reset(MBB.getParent()->getRegInfo(),
+          LIS.getSlotIndexes()->getMBBEndIdx(&MBB));
+  }
+
+  // reset tracker to the point just after MI (in program order).
+  void reset(const MachineInstr &MI) {
+    reset(MI.getMF()->getRegInfo(), LIS.getInstructionIndex(MI).getDeadSlot());
   }
 
-  // move to the state just above the MI
+  // move to the state just before the MI (in program order).
   void recede(const MachineInstr &MI);
 
   // checks whether the tracker's state after receding MI corresponds
-  // to reported by LIS
+  // to reported by LIS.
   bool isValid() const;
+
+  // deprecated.
+  decltype(MaxPressure) moveMaxPressure() = delete;
----------------
jayfoad wrote:

Might be simpler to move the base class moveMaxPressure into GCNDownwardRPTracker?

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


More information about the llvm-commits mailing list