diff options
| author | Andrew Trick <atrick@apple.com> | 2012-06-11 23:42:23 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2012-06-11 23:42:23 +0000 |
| commit | 3e465fb225ee2c50edeffda34183991da6300d2d (patch) | |
| tree | 150183aef49ae7096c75ec2e0ee3f220c21b8a23 | |
| parent | d054bd833a76496bbbde8abbfcd7ba7658bdf650 (diff) | |
| download | bcm5719-llvm-3e465fb225ee2c50edeffda34183991da6300d2d.tar.gz bcm5719-llvm-3e465fb225ee2c50edeffda34183991da6300d2d.zip | |
misched: When querying RegisterPressureTracker, always save current and max pressure.
llvm-svn: 158340
| -rw-r--r-- | llvm/include/llvm/CodeGen/RegisterPressure.h | 13 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegisterPressure.cpp | 10 |
2 files changed, 16 insertions, 7 deletions
diff --git a/llvm/include/llvm/CodeGen/RegisterPressure.h b/llvm/include/llvm/CodeGen/RegisterPressure.h index e810f8c64bb..2043155bc53 100644 --- a/llvm/include/llvm/CodeGen/RegisterPressure.h +++ b/llvm/include/llvm/CodeGen/RegisterPressure.h @@ -249,19 +249,22 @@ public: /// Get the pressure of each PSet after traversing this instruction bottom-up. void getUpwardPressure(const MachineInstr *MI, - std::vector<unsigned> &PressureResult); + std::vector<unsigned> &PressureResult, + std::vector<unsigned> &MaxPressureResult); /// Get the pressure of each PSet after traversing this instruction top-down. void getDownwardPressure(const MachineInstr *MI, - std::vector<unsigned> &PressureResult); + std::vector<unsigned> &PressureResult, + std::vector<unsigned> &MaxPressureResult); void getPressureAfterInst(const MachineInstr *MI, - std::vector<unsigned> &PressureResult) { + std::vector<unsigned> &PressureResult, + std::vector<unsigned> &MaxPressureResult) { if (isTopClosed()) - return getUpwardPressure(MI, PressureResult); + return getUpwardPressure(MI, PressureResult, MaxPressureResult); assert(isBottomClosed() && "Uninitialized pressure tracker"); - return getDownwardPressure(MI, PressureResult); + return getDownwardPressure(MI, PressureResult, MaxPressureResult); } protected: diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp index 52174d8f37e..43448c850a0 100644 --- a/llvm/lib/CodeGen/RegisterPressure.cpp +++ b/llvm/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); } |

