summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-06-11 23:42:23 +0000
committerAndrew Trick <atrick@apple.com>2012-06-11 23:42:23 +0000
commit0eb3a3524e9d68642e574780d19c781386ed4469 (patch)
treed7d8bcb299ce52a078b8bf18c5adfa05235bc88d /lib/CodeGen/RegisterPressure.cpp
parent4487479543d58df84bb403f4bcfd33f72aadfa18 (diff)
downloadllvm-0eb3a3524e9d68642e574780d19c781386ed4469.tar.gz
llvm-0eb3a3524e9d68642e574780d19c781386ed4469.tar.bz2
llvm-0eb3a3524e9d68642e574780d19c781386ed4469.tar.xz
misched: When querying RegisterPressureTracker, always save current and max pressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--lib/CodeGen/RegisterPressure.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/RegisterPressure.cpp b/lib/CodeGen/RegisterPressure.cpp
index 52174d8f37..43448c850a 100644
--- a/lib/CodeGen/RegisterPressure.cpp
+++ b/lib/CodeGen/RegisterPressure.cpp
@@ -811,25 +811,31 @@ getMaxDownwardPressureDelta(const MachineInstr *MI, RegPressureDelta &Delta,
/// Get the pressure of each PSet after traversing this instruction bottom-up.
void RegPressureTracker::
getUpwardPressure(const MachineInstr *MI,
- std::vector<unsigned> &PressureResult) {
+ std::vector<unsigned> &PressureResult,
+ std::vector<unsigned> &MaxPressureResult) {
// Snapshot pressure.
PressureResult = CurrSetPressure;
+ MaxPressureResult = P.MaxSetPressure;
bumpUpwardPressure(MI);
// Current pressure becomes the result. Restore current pressure.
+ P.MaxSetPressure.swap(MaxPressureResult);
CurrSetPressure.swap(PressureResult);
}
/// Get the pressure of each PSet after traversing this instruction top-down.
void RegPressureTracker::
getDownwardPressure(const MachineInstr *MI,
- std::vector<unsigned> &PressureResult) {
+ std::vector<unsigned> &PressureResult,
+ std::vector<unsigned> &MaxPressureResult) {
// Snapshot pressure.
PressureResult = CurrSetPressure;
+ MaxPressureResult = P.MaxSetPressure;
bumpDownwardPressure(MI);
// Current pressure becomes the result. Restore current pressure.
+ P.MaxSetPressure.swap(MaxPressureResult);
CurrSetPressure.swap(PressureResult);
}