summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-15 21:16:21 +0000
committerMatthias Braun <matze@braunis.de>2014-12-15 21:16:21 +0000
commit0352201e15747ea43eed75af68107ed4df6fadc8 (patch)
tree1ce6133831316bdcce856b635ac6c9627c8c4cc7 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parentaac43c6a7743bc29dd00953cb3e4fe9bca13244a (diff)
downloadbcm5719-llvm-0352201e15747ea43eed75af68107ed4df6fadc8.tar.gz
bcm5719-llvm-0352201e15747ea43eed75af68107ed4df6fadc8.zip
LiveRangeCalc: Rewrite subrange calculation
This changes subrange calculation to calculate subranges sequentially instead of in parallel. The code is easier to understand that way and addresses the code review issues raised about LiveOutData being hard to understand/needing more comments by removing them :) llvm-svn: 224272
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index f48be4d5eb0..b71e819f0d3 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -192,8 +192,7 @@ void LiveIntervals::computeVirtRegInterval(LiveInterval &LI) {
assert(LRCalc && "LRCalc not initialized.");
assert(LI.empty() && "Should only compute empty intervals.");
LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator());
- LRCalc->createDeadDefs(LI);
- LRCalc->extendToUses(LI);
+ LRCalc->calculate(LI);
computeDeadValues(LI, LI);
}
@@ -254,19 +253,12 @@ void LiveIntervals::computeRegUnitRange(LiveRange &LR, unsigned Unit) {
for (MCRegUnitRootIterator Roots(Unit, TRI); Roots.isValid(); ++Roots) {
for (MCSuperRegIterator Supers(*Roots, TRI, /*IncludeSelf=*/true);
Supers.isValid(); ++Supers) {
- if (!MRI->reg_empty(*Supers))
- LRCalc->createDeadDefs(LR, *Supers);
- }
- }
-
- // Now extend LR to reach all uses.
- // Ignore uses of reserved registers. We only track defs of those.
- for (MCRegUnitRootIterator Roots(Unit, TRI); Roots.isValid(); ++Roots) {
- for (MCSuperRegIterator Supers(*Roots, TRI, /*IncludeSelf=*/true);
- Supers.isValid(); ++Supers) {
unsigned Reg = *Supers;
- if (!MRI->isReserved(Reg) && !MRI->reg_empty(Reg))
- LRCalc->extendToUses(LR, Reg);
+ if (MRI->reg_empty(Reg))
+ continue;
+ // Ignore uses of reserved registers. We only track defs of those.
+ bool IgnoreUses = MRI->isReserved(Reg);
+ LRCalc->calculate(LR, *Supers, IgnoreUses);
}
}
}
OpenPOWER on IntegriCloud