[llvm-commits] [llvm] r157423 - in /llvm/trunk/lib/CodeGen: RegisterPressure.cpp RegisterPressure.h
Andrew Trick
atrick at apple.com
Thu May 24 15:10:59 PDT 2012
Author: atrick
Date: Thu May 24 17:10:59 2012
New Revision: 157423
URL: http://llvm.org/viewvc/llvm-project?rev=157423&view=rev
Log:
regpressure: Added RegisterPressure::dump
Modified:
llvm/trunk/lib/CodeGen/RegisterPressure.cpp
llvm/trunk/lib/CodeGen/RegisterPressure.h
Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=157423&r1=157422&r2=157423&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu May 24 17:10:59 2012
@@ -18,6 +18,8 @@
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@ -61,6 +63,22 @@
decreaseSetPressure(MaxSetPressure, RC, TRI);
}
+void RegisterPressure::dump(const TargetRegisterInfo *TRI) {
+ dbgs() << "Live In: ";
+ for (unsigned i = 0, e = LiveInRegs.size(); i < e; ++i)
+ dbgs() << PrintReg(LiveInRegs[i], TRI) << " ";
+ dbgs() << '\n';
+ dbgs() << "Live Out: ";
+ for (unsigned i = 0, e = LiveOutRegs.size(); i < e; ++i)
+ dbgs() << PrintReg(LiveOutRegs[i], TRI) << " ";
+ dbgs() << '\n';
+ for (unsigned i = 0, e = MaxSetPressure.size(); i < e; ++i) {
+ if (MaxSetPressure[i] != 0)
+ dbgs() << TRI->getRegPressureSetName(i) << "=" << MaxSetPressure[i]
+ << '\n';
+ }
+}
+
/// Increase the current pressure as impacted by these physical registers and
/// bump the high water mark if needed.
void RegPressureTracker::increasePhysRegPressure(ArrayRef<unsigned> Regs) {
Modified: llvm/trunk/lib/CodeGen/RegisterPressure.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.h?rev=157423&r1=157422&r2=157423&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.h (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.h Thu May 24 17:10:59 2012
@@ -42,6 +42,8 @@
/// Decrease register pressure for each pressure set impacted by this register
/// class. This is only useful to account for spilling or rematerialization.
void decrease(const TargetRegisterClass *RC, const TargetRegisterInfo *TRI);
+
+ void dump(const TargetRegisterInfo *TRI);
};
/// RegisterPressure computed within a region of instructions delimited by
More information about the llvm-commits
mailing list