aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.cpp
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
commit09c45d2fe8fb0564ea2095f77fc79e184aa0a1a7 (patch)
tree7e80b01ff1ff64982ebc880bdb517264f6b62c01 /lib/CodeGen/SplitKit.cpp
parent2dee7a527b083e259f9e826c57c1e5dab9540798 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.cpp')
-rw-r--r--lib/CodeGen/SplitKit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 1753c2ef86..2430161eca 100644
--- a/lib/CodeGen/SplitKit.cpp
+++ b/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.