X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FRegisterPressure.h;h=2043155bc53f51c9cca473b506c2a3e26b0e85a9;hb=3d71688476951d56ac00a81b17c2f83fd781b208;hp=dd7ba86d1934243f305b85a1a0da743a5f87d768;hpb=afc2657cc33988a178d3b21645dba54484600c5f;p=oota-llvm.git diff --git a/include/llvm/CodeGen/RegisterPressure.h b/include/llvm/CodeGen/RegisterPressure.h index dd7ba86d193..2043155bc53 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 &getRegSetPressureAtPos() { return CurrSetPressure; } + void discoverPhysLiveIn(unsigned Reg); void discoverPhysLiveOut(unsigned Reg); @@ -243,12 +247,35 @@ public: MaxPressureLimit); } + /// Get the pressure of each PSet after traversing this instruction bottom-up. + void getUpwardPressure(const MachineInstr *MI, + std::vector &PressureResult, + std::vector &MaxPressureResult); + + /// Get the pressure of each PSet after traversing this instruction top-down. + void getDownwardPressure(const MachineInstr *MI, + std::vector &PressureResult, + std::vector &MaxPressureResult); + + void getPressureAfterInst(const MachineInstr *MI, + std::vector &PressureResult, + std::vector &MaxPressureResult) { + if (isTopClosed()) + return getUpwardPressure(MI, PressureResult, MaxPressureResult); + + assert(isBottomClosed() && "Uninitialized pressure tracker"); + return getDownwardPressure(MI, PressureResult, MaxPressureResult); + } + protected: void increasePhysRegPressure(ArrayRef Regs); void decreasePhysRegPressure(ArrayRef Regs); void increaseVirtRegPressure(ArrayRef Regs); void decreaseVirtRegPressure(ArrayRef Regs); + + void bumpUpwardPressure(const MachineInstr *MI); + void bumpDownwardPressure(const MachineInstr *MI); }; } // end namespace llvm