[llvm] [AMDGPU] GCNRegPressure printing pass for testing. (PR #70031)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 22:39:50 PDT 2023
================
@@ -487,3 +488,111 @@ LLVM_DUMP_METHOD
void GCNRegPressure::dump() const { dbgs() << print(*this); }
#endif
+
+static cl::opt<bool> UseDownwardTracker(
+ "amdgpu-print-rp-downward",
+ cl::desc("Use GCNDownwardRPTracker for GCNRegPressurePrinter pass"),
+ cl::init(false), cl::Hidden);
+
+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>();
+
+ auto &OS = dbgs();
+
+// Leading spaces are important for YAML syntax.
+#define PFX " "
----------------
arsenm wrote:
does a constexpr constant string work?
https://github.com/llvm/llvm-project/pull/70031
More information about the llvm-commits
mailing list