summaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/LiveRangeEdit.h
diff options
context:
space:
mode:
authorMark Lacey <mark.lacey@apple.com>2013-08-14 23:50:16 +0000
committerMark Lacey <mark.lacey@apple.com>2013-08-14 23:50:16 +0000
commite742d687369f79702894b6cf302e1f222c5d7432 (patch)
tree3b457db8222f102cf594253a0743b66c3023b64b /include/llvm/CodeGen/LiveRangeEdit.h
parent3bbd96e90be56c39a0b527fc6d5ccd8af4426a03 (diff)
downloadexternal_llvm-e742d687369f79702894b6cf302e1f222c5d7432.zip
external_llvm-e742d687369f79702894b6cf302e1f222c5d7432.tar.gz
external_llvm-e742d687369f79702894b6cf302e1f222c5d7432.tar.bz2
Auto-compute live intervals on demand.
When new virtual registers are created during splitting/spilling, defer creation of the live interval until we need to use the live interval. Along with the recent commits to notify LiveRangeEdit when new virtual registers are created, this makes it possible for functions like TargetInstrInfo::loadRegFromStackSlot() and TargetInstrInfo::storeRegToStackSlot() to create multiple virtual registers as part of the process of generating loads/stores for different register classes, and then have the live intervals for those new registers computed when they are needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/LiveRangeEdit.h')
-rw-r--r--include/llvm/CodeGen/LiveRangeEdit.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveRangeEdit.h b/include/llvm/CodeGen/LiveRangeEdit.h
index 43a9566..7edf67c 100644
--- a/include/llvm/CodeGen/LiveRangeEdit.h
+++ b/include/llvm/CodeGen/LiveRangeEdit.h
@@ -144,12 +144,19 @@ public:
return makeArrayRef(NewRegs).slice(FirstNew);
}
+ /// createEmptyIntervalFrom - Create a new empty interval based on OldReg.
+ LiveInterval &createEmptyIntervalFrom(unsigned OldReg);
+
/// createFrom - Create a new virtual register based on OldReg.
- LiveInterval &createFrom(unsigned OldReg);
+ unsigned createFrom(unsigned OldReg);
/// create - Create a new register with the same class and original slot as
/// parent.
- LiveInterval &create() {
+ LiveInterval &createEmptyInterval() {
+ return createEmptyIntervalFrom(getReg());
+ }
+
+ unsigned create() {
return createFrom(getReg());
}