summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-12 23:02:57 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-12 23:02:57 +0000
commit991e4ee860b6d89c1c6d4e383ae92923de7b7fc6 (patch)
treef67fc8c16c99032a262ef342f96cd2496fcf0702
parent32c181c4442db7eb326cebbe1c7d8b7bbd94132e (diff)
downloadbcm5719-llvm-991e4ee860b6d89c1c6d4e383ae92923de7b7fc6.tar.gz
bcm5719-llvm-991e4ee860b6d89c1c6d4e383ae92923de7b7fc6.zip
Handle an empty dupli.
This can happen if the original interval has been broken into two disconnected parts. Ideally, we should be able to detect when the graph is disconnected and create separate intervals, but that code is not implemented yet. Example: Two basic blocks are both branching to a loop header. Our interval is defined in both basic blocks, and live into the loop along both edges. We decide to split the interval around the loop. The interval is split into an inside part and an outside part. The outside part now has two disconnected segments, one in each basic block. If we later decide to split the outside interval into single blocks, we get one interval per basic block and an empty dupli for the remainder. llvm-svn: 110976
-rw-r--r--llvm/lib/CodeGen/SplitKit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 1753c2ef86f..2430161ecae 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -674,8 +674,14 @@ void SplitEditor::rewrite() {
// dupli_ goes in last, after rewriting.
if (dupli_) {
- dupli_->RenumberValues(lis_);
- intervals_.push_back(dupli_);
+ if (dupli_->empty()) {
+ DEBUG(dbgs() << " dupli became empty?\n");
+ lis_.removeInterval(dupli_->reg);
+ dupli_ = 0;
+ } else {
+ dupli_->RenumberValues(lis_);
+ intervals_.push_back(dupli_);
+ }
}
// Calculate spill weight and allocation hints for new intervals.
OpenPOWER on IntegriCloud