aboutsummaryrefslogtreecommitdiffstats
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
commitd49638d917cd3d868c65937213016953932ab197 (patch)
tree7e80b01ff1ff64982ebc880bdb517264f6b62c01 /lib/CodeGen/SplitKit.cpp
parent5bac38b2ba90ba5bfe1a25a34f4bc3a39d55010d (diff)
downloadexternal_llvm-d49638d917cd3d868c65937213016953932ab197.zip
external_llvm-d49638d917cd3d868c65937213016953932ab197.tar.gz
external_llvm-d49638d917cd3d868c65937213016953932ab197.tar.bz2
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 1753c2e..2430161 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.