From 09c45d2fe8fb0564ea2095f77fc79e184aa0a1a7 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 12 Aug 2010 23:02:57 +0000 Subject: 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 --- lib/CodeGen/SplitKit.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/SplitKit.cpp') 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. -- cgit v1.2.3-18-g5258