summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-07-16 18:55:35 +0000
committerMatthias Braun <matze@braunis.de>2015-07-16 18:55:35 +0000
commit0d4cebd434c6aa95a5fd089e6feee126493e416f (patch)
treeea6f0b935a3c1f2d3026b2f53ebededaa2ee4225 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent7f5ae19e803d3a2faba71b17cde925a43a602a33 (diff)
downloadbcm5719-llvm-0d4cebd434c6aa95a5fd089e6feee126493e416f.tar.gz
bcm5719-llvm-0d4cebd434c6aa95a5fd089e6feee126493e416f.zip
LiveInterval: Document and enforce rules about empty subranges.
Empty subranges are not allowed in a LiveInterval and must be removed instead: Check this in the verifiers, put a reminder for this in the comment of the shrinkToUses variant for a single lane and make it automatic for the shrinkToUses variant for a LiveInterval. llvm-svn: 242431
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index ee7c1d30315..9738dac65ad 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -403,9 +403,14 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
&& "Can only shrink virtual registers");
// Shrink subregister live ranges.
+ bool NeedsCleanup = false;
for (LiveInterval::SubRange &S : li->subranges()) {
shrinkToUses(S, li->reg);
+ if (S.empty())
+ NeedsCleanup = true;
}
+ if (NeedsCleanup)
+ li->removeEmptySubRanges();
// Find all the values used, including PHI kills.
ShrinkToUsesWorkList WorkList;
OpenPOWER on IntegriCloud