diff options
author | Andrew Trick <atrick@apple.com> | 2012-12-05 21:37:42 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-12-05 21:37:42 +0000 |
commit | 553c42cefc9abe1f10ee33d34a12498b8ac12fe6 (patch) | |
tree | b9be40e319a9d3817a9913cf982b108391d7fc48 /include/llvm/CodeGen/RegisterPressure.h | |
parent | 0602bb46596485b43fa8b86abbc8485d502025ce (diff) | |
download | llvm-553c42cefc9abe1f10ee33d34a12498b8ac12fe6.tar.gz llvm-553c42cefc9abe1f10ee33d34a12498b8ac12fe6.tar.bz2 llvm-553c42cefc9abe1f10ee33d34a12498b8ac12fe6.tar.xz |
RegisterPresssureTracker: Track live physical register by unit.
This is much simpler to reason about, more efficient, and
fixes some corner cases involving implicit super-register defs.
Fixed rdar://12797931.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/RegisterPressure.h')
-rw-r--r-- | include/llvm/CodeGen/RegisterPressure.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/RegisterPressure.h b/include/llvm/CodeGen/RegisterPressure.h index 20312be300..edff782f7b 100644 --- a/include/llvm/CodeGen/RegisterPressure.h +++ b/include/llvm/CodeGen/RegisterPressure.h @@ -30,7 +30,7 @@ struct RegisterPressure { /// Map of max reg pressure indexed by pressure set ID, not class ID. std::vector<unsigned> MaxSetPressure; - /// List of live in registers. + /// List of live in virtual registers or physical register units. SmallVector<unsigned,8> LiveInRegs; SmallVector<unsigned,8> LiveOutRegs; @@ -39,10 +39,16 @@ struct RegisterPressure { /// to account for live through (global liveness). void increase(const TargetRegisterClass *RC, const TargetRegisterInfo *TRI); + /// Increase pressure for each pressure set impacted by this register unit. + void increase(unsigned RU, const TargetRegisterInfo *TRI); + /// Decrease register pressure for each pressure set impacted by this register /// class. This is only useful to account for spilling or rematerialization. void decrease(const TargetRegisterClass *RC, const TargetRegisterInfo *TRI); + /// Decrease pressure for each pressure set impacted by this register unit. + void decrease(unsigned RU, const TargetRegisterInfo *TRI); + void dump(const TargetRegisterInfo *TRI) const; }; @@ -172,8 +178,9 @@ public: const LiveIntervals *lis, const MachineBasicBlock *mbb, MachineBasicBlock::const_iterator pos); - /// Force liveness of registers. Particularly useful to initialize the - /// livein/out state of the tracker before the first call to advance/recede. + /// Force liveness of virtual registers or physical register + /// units. Particularly useful to initialize the livein/out state of the + /// tracker before the first call to advance/recede. void addLiveRegs(ArrayRef<unsigned> Regs); /// Get the MI position corresponding to this register pressure. |