[llvm] [AMDGPU] Optionally Use GCNRPTrackers during scheduling (PR #93090)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 00:38:02 PDT 2024


================
@@ -151,14 +157,42 @@ static bool canUsePressureDiffs(const SUnit &SU) {
 static void getRegisterPressures(bool AtTop,
                                  const RegPressureTracker &RPTracker, SUnit *SU,
                                  std::vector<unsigned> &Pressure,
-                                 std::vector<unsigned> &MaxPressure) {
+                                 std::vector<unsigned> &MaxPressure,
+                                 GCNDownwardRPTracker &DownwardTracker,
+                                 GCNUpwardRPTracker &UpwardTracker,
+                                 ScheduleDAGMI *DAG) {
   // getDownwardPressure() and getUpwardPressure() make temporary changes to
   // the tracker, so we need to pass those function a non-const copy.
   RegPressureTracker &TempTracker = const_cast<RegPressureTracker &>(RPTracker);
-  if (AtTop)
-    TempTracker.getDownwardPressure(SU->getInstr(), Pressure, MaxPressure);
-  else
-    TempTracker.getUpwardPressure(SU->getInstr(), Pressure, MaxPressure);
+  if (!GCNTrackers) {
+    if (AtTop)
+      TempTracker.getDownwardPressure(SU->getInstr(), Pressure, MaxPressure);
+    else
+      TempTracker.getUpwardPressure(SU->getInstr(), Pressure, MaxPressure);
+  } else {
----------------
Pierre-vh wrote:

early return instead of else

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


More information about the llvm-commits mailing list