From d202899431e49484d907608dbe74fa6d708bb07b Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 15 Aug 2019 18:49:39 +0000 Subject: [PATCH] [NFC] Add a couple of dump routines for RegisterPressure helper classes llvm-svn: 369037 --- llvm/include/llvm/CodeGen/RegisterPressure.h | 3 +++ llvm/lib/CodeGen/RegisterPressure.cpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/llvm/include/llvm/CodeGen/RegisterPressure.h b/llvm/include/llvm/CodeGen/RegisterPressure.h index 996f83d3b4aa..92333b859f1b 100644 --- a/llvm/include/llvm/CodeGen/RegisterPressure.h +++ b/llvm/include/llvm/CodeGen/RegisterPressure.h @@ -129,6 +129,8 @@ public: bool operator==(const PressureChange &RHS) const { return PSetID == RHS.PSetID && UnitInc == RHS.UnitInc; } + + void dump() const; }; /// List of PressureChanges in order of increasing, unique PSetID. @@ -248,6 +250,7 @@ struct RegPressureDelta { bool operator!=(const RegPressureDelta &RHS) const { return !operator==(RHS); } + void dump() const; }; /// A set of live virtual registers and physical register units. diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp index cdcbabfa2581..8a287635c81b 100644 --- a/llvm/lib/CodeGen/RegisterPressure.cpp +++ b/llvm/lib/CodeGen/RegisterPressure.cpp @@ -134,6 +134,22 @@ void PressureDiff::dump(const TargetRegisterInfo &TRI) const { } dbgs() << '\n'; } + +LLVM_DUMP_METHOD +void PressureChange::dump() const { + dbgs() << "[" << getPSetOrMax() << ", " << getUnitInc() << "]\n"; +} + +void RegPressureDelta::dump() const { + dbgs() << "[Excess="; + Excess.dump(); + dbgs() << ", CriticalMax="; + CriticalMax.dump(); + dbgs() << ", CurrentMax="; + CurrentMax.dump(); + dbgs() << "]\n"; +} + #endif void RegPressureTracker::increaseRegPressure(unsigned RegUnit,