summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-09-04 20:59:59 +0000
committerAndrew Trick <atrick@apple.com>2013-09-04 20:59:59 +0000
commit42ebb3ad41813af292cfa681c1fe2aadd1008721 (patch)
treeabf0f2834ec7c7d95ab971b842a338cf40b15596 /lib/CodeGen/RegisterPressure.cpp
parentb4b7a52ec57ff5d403f6526f24841b1ef81f8706 (diff)
downloadllvm-42ebb3ad41813af292cfa681c1fe2aadd1008721.tar.gz
llvm-42ebb3ad41813af292cfa681c1fe2aadd1008721.tar.bz2
llvm-42ebb3ad41813af292cfa681c1fe2aadd1008721.tar.xz
Added -misched-regpressure option.
Register pressure tracking is half the complexity of the scheduler. It's useful to be able to turn it off for compile time and performance comparisons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--lib/CodeGen/RegisterPressure.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/CodeGen/RegisterPressure.cpp b/lib/CodeGen/RegisterPressure.cpp
index 27da370c96..260eacdca6 100644
--- a/lib/CodeGen/RegisterPressure.cpp
+++ b/lib/CodeGen/RegisterPressure.cpp
@@ -153,6 +153,24 @@ const LiveInterval *RegPressureTracker::getInterval(unsigned Reg) const {
return LIS->getCachedRegUnit(Reg);
}
+void RegPressureTracker::reset() {
+ MBB = 0;
+ LIS = 0;
+
+ CurrSetPressure.clear();
+ LiveThruPressure.clear();
+ P.MaxSetPressure.clear();
+
+ if (RequireIntervals)
+ static_cast<IntervalPressure&>(P).reset();
+ else
+ static_cast<RegionPressure&>(P).reset();
+
+ LiveRegs.PhysRegs.clear();
+ LiveRegs.VirtRegs.clear();
+ UntiedDefs.clear();
+}
+
/// Setup the RegPressureTracker.
///
/// TODO: Add support for pressure without LiveIntervals.
@@ -163,6 +181,8 @@ void RegPressureTracker::init(const MachineFunction *mf,
MachineBasicBlock::const_iterator pos,
bool ShouldTrackUntiedDefs)
{
+ reset();
+
MF = mf;
TRI = MF->getTarget().getRegisterInfo();
RCI = rci;
@@ -177,19 +197,11 @@ void RegPressureTracker::init(const MachineFunction *mf,
CurrPos = pos;
CurrSetPressure.assign(TRI->getNumRegPressureSets(), 0);
- LiveThruPressure.clear();
- if (RequireIntervals)
- static_cast<IntervalPressure&>(P).reset();
- else
- static_cast<RegionPressure&>(P).reset();
P.MaxSetPressure = CurrSetPressure;
- LiveRegs.PhysRegs.clear();
LiveRegs.PhysRegs.setUniverse(TRI->getNumRegs());
- LiveRegs.VirtRegs.clear();
LiveRegs.VirtRegs.setUniverse(MRI->getNumVirtRegs());
- UntiedDefs.clear();
if (TrackUntiedDefs)
UntiedDefs.setUniverse(MRI->getNumVirtRegs());
}