[llvm] [AMDGPU] GCNRegPressure printing pass for testing. (PR #70031)

Valery Pykhtin via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 13:39:40 PDT 2023


================
@@ -487,3 +488,77 @@ LLVM_DUMP_METHOD
 void GCNRegPressure::dump() const { dbgs() << print(*this); }
 
 #endif
+
+char llvm::GCNRegPressurePrinter::ID = 0;
+char &llvm::GCNRegPressurePrinterID = GCNRegPressurePrinter::ID;
+
+INITIALIZE_PASS(GCNRegPressurePrinter, "amdgpu-print-rp", "", true, true)
+
+bool GCNRegPressurePrinter::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(MF.getFunction()))
+    return false;
+
+  const MachineRegisterInfo &MRI = MF.getRegInfo();
+  const LiveIntervals &LIS = getAnalysis<LiveIntervals>();
+  GCNUpwardRPTracker RPT(LIS);
----------------
vpykhtin wrote:

They disagree from the very first attempt and it is very inconvenient to have two Filecheck prefixes for upward and downward trackers because it's not easy to compare. We can track RP both ways and print the difference at each position if it exists.

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


More information about the llvm-commits mailing list