summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-10 19:31:50 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-10 19:31:50 +0000
commitcfa7134a9c33c0c7f8dda359c89dc6763a258e07 (patch)
tree5b668c0867f05cb0bb01a5855aa5da7b2e1c91c4 /lib/CodeGen/SplitKit.h
parentf4baeaf8485f01beda46d29fd55753199dc68070 (diff)
downloadllvm-cfa7134a9c33c0c7f8dda359c89dc6763a258e07.tar.gz
llvm-cfa7134a9c33c0c7f8dda359c89dc6763a258e07.tar.bz2
llvm-cfa7134a9c33c0c7f8dda359c89dc6763a258e07.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 395df75c5c..b1d5a47804 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/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;