diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-10 19:31:50 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-10 19:31:50 +0000 |
commit | 6ee7d9aadeb871fa13324731c2ee50d54cc317fa (patch) | |
tree | 71002a0e0ba26d2064af74ff1ef76844bb751507 /llvm/lib/CodeGen/SplitKit.h | |
parent | 89eb6a8b94e054b5afaf87969fd24d9ceb7b92dc (diff) | |
download | bcm5719-llvm-6ee7d9aadeb871fa13324731c2ee50d54cc317fa.tar.gz bcm5719-llvm-6ee7d9aadeb871fa13324731c2ee50d54cc317fa.zip |
Basic rematerialization during splitting.
Whenever splitting wants to insert a copy, it checks if the value can be
rematerialized cheaply instead.
Missing features:
- Delete instructions when all uses have been rematerialized.
- Truncate live ranges to the remaining uses after rematerialization.
llvm-svn: 118702
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.h')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.h b/llvm/lib/CodeGen/SplitKit.h index 395df75c5c5..b1d5a47804f 100644 --- a/llvm/lib/CodeGen/SplitKit.h +++ b/llvm/lib/CodeGen/SplitKit.h @@ -26,6 +26,7 @@ class MachineLoop; class MachineLoopInfo; class MachineRegisterInfo; class TargetInstrInfo; +class TargetRegisterInfo; class VirtRegMap; class VNInfo; class raw_ostream; @@ -245,14 +246,6 @@ public: /// All needed values whose def is not inside [Start;End) must be defined /// beforehand so mapValue will work. void addRange(SlotIndex Start, SlotIndex End); - - /// defByCopy- Insert a copy from parentli to li, assuming that ParentVNI is - /// live at the insert location. Add a minimal live range for the new value - /// and return it. - VNInfo *defByCopy(const VNInfo *ParentVNI, - MachineBasicBlock &MBB, - MachineBasicBlock::iterator I); - }; @@ -273,6 +266,7 @@ class SplitEditor { VirtRegMap &vrm_; MachineRegisterInfo &mri_; const TargetInstrInfo &tii_; + const TargetRegisterInfo &tri_; /// edit_ - The current parent register and new intervals created. LiveRangeEdit &edit_; @@ -285,6 +279,14 @@ class SplitEditor { /// Currently open LiveInterval. LiveIntervalMap openli_; + /// defFromParent - Define Reg from ParentVNI at UseIdx using either + /// rematerialization or a COPY from parent. Return the new value. + VNInfo *defFromParent(LiveIntervalMap &Reg, + VNInfo *ParentVNI, + SlotIndex UseIdx, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator I); + /// intervalsLiveAt - Return true if any member of intervals_ is live at Idx. bool intervalsLiveAt(SlotIndex Idx) const; |