summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/RegisterPressure.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-06-09 02:16:58 +0000
committerAndrew Trick <atrick@apple.com>2012-06-09 02:16:58 +0000
commitba17293a8827a7e0e390b0a1d6075148a58d9edd (patch)
tree18cf8c7868d12b08f1345b48ccb4872d4990a19c /include/llvm/CodeGen/RegisterPressure.h
parent8879480ed708ffa51d23f423ec316763c7cb9577 (diff)
downloadllvm-ba17293a8827a7e0e390b0a1d6075148a58d9edd.tar.gz
llvm-ba17293a8827a7e0e390b0a1d6075148a58d9edd.tar.bz2
llvm-ba17293a8827a7e0e390b0a1d6075148a58d9edd.tar.xz
Register pressure: added getPressureAfterInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/RegisterPressure.h')
-rw-r--r--include/llvm/CodeGen/RegisterPressure.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/RegisterPressure.h b/include/llvm/CodeGen/RegisterPressure.h
index dd7ba86d19..e810f8c64b 100644
--- a/include/llvm/CodeGen/RegisterPressure.h
+++ b/include/llvm/CodeGen/RegisterPressure.h
@@ -198,6 +198,10 @@ public:
/// or if closeRegion() was explicitly invoked.
RegisterPressure &getPressure() { return P; }
+ /// Get the register set pressure at the current position, which may be less
+ /// than the pressure across the traversed region.
+ std::vector<unsigned> &getRegSetPressureAtPos() { return CurrSetPressure; }
+
void discoverPhysLiveIn(unsigned Reg);
void discoverPhysLiveOut(unsigned Reg);
@@ -243,12 +247,32 @@ public:
MaxPressureLimit);
}
+ /// Get the pressure of each PSet after traversing this instruction bottom-up.
+ void getUpwardPressure(const MachineInstr *MI,
+ std::vector<unsigned> &PressureResult);
+
+ /// Get the pressure of each PSet after traversing this instruction top-down.
+ void getDownwardPressure(const MachineInstr *MI,
+ std::vector<unsigned> &PressureResult);
+
+ void getPressureAfterInst(const MachineInstr *MI,
+ std::vector<unsigned> &PressureResult) {
+ if (isTopClosed())
+ return getUpwardPressure(MI, PressureResult);
+
+ assert(isBottomClosed() && "Uninitialized pressure tracker");
+ return getDownwardPressure(MI, PressureResult);
+ }
+
protected:
void increasePhysRegPressure(ArrayRef<unsigned> Regs);
void decreasePhysRegPressure(ArrayRef<unsigned> Regs);
void increaseVirtRegPressure(ArrayRef<unsigned> Regs);
void decreaseVirtRegPressure(ArrayRef<unsigned> Regs);
+
+ void bumpUpwardPressure(const MachineInstr *MI);
+ void bumpDownwardPressure(const MachineInstr *MI);
};
} // end namespace llvm