[llvm] [AMDGPU][MISCHED] GCNBalancedSchedStrategy. (PR #68229)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 08:51:58 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {clang-format}-->

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 8899b713ea65f038d29043d5801283d2a79d4ed4 f4463b3a1a9cdf063ae44d232b65e02e548a00f9 -- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 78bb5790a727..35c5aedf92f6 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -463,8 +463,8 @@ createGCNMaxILPMachineScheduler(MachineSchedContext *C) {
 static ScheduleDAGInstrs *
 createGCNBalancedMachineScheduler(MachineSchedContext *C) {
   const GCNSubtarget &ST = C->MF->getSubtarget<GCNSubtarget>();
-  ScheduleDAGMILive *DAG =
-    new GCNScheduleDAGMILive(C, std::make_unique<GCNBalancedSchedStrategy>(C));
+  ScheduleDAGMILive *DAG = new GCNScheduleDAGMILive(
+      C, std::make_unique<GCNBalancedSchedStrategy>(C));
   DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI));
   if (ST.shouldClusterStores())
     DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI));
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
index 84dbf0ce3e79..6790cfdc540d 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
@@ -118,7 +118,7 @@ public:
   GCNSchedStageID getNextStage() const;
 
   virtual bool computeScheduleMetric(unsigned RegionIdx, unsigned WavesAfter,
-                                    unsigned WavesBefore) {
+                                     unsigned WavesBefore) {
     return false;
   }
   virtual void clearMetric(){};
@@ -434,7 +434,8 @@ class GCNBalancedSchedStrategy final : public GCNSchedStrategy {
   }
 
 #ifndef NDEBUG
-  std::set<std::pair<MachineInstr *, unsigned>, EarlierIssuingCycle> PrintableSchedule;
+  std::set<std::pair<MachineInstr *, unsigned>, EarlierIssuingCycle>
+      PrintableSchedule;
 
   void printSchedule() {
     if (PrintableSchedule.empty())
@@ -456,11 +457,9 @@ class GCNBalancedSchedStrategy final : public GCNSchedStrategy {
       IPrev = I.second;
     }
     dbgs() << "\n\t"
-             << "Metric: "
-             << (StallTotal
-                     ? (StallTotal * ScaleFactor) / CurrCycle
-                     : 1)
-             << "\n\n";
+           << "Metric: "
+           << (StallTotal ? (StallTotal * ScaleFactor) / CurrCycle : 1)
+           << "\n\n";
   }
 #endif
 
@@ -479,7 +478,7 @@ public:
   }
 
   bool computeScheduleMetric(unsigned RegionIdx, unsigned WavesAfter,
-                            unsigned WavesBefore) override;
+                             unsigned WavesBefore) override;
 };
 
 } // End namespace llvm

``````````

</details>


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


More information about the llvm-commits mailing list