[llvm-commits] [llvm] r110976 - /llvm/trunk/lib/CodeGen/SplitKit.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Aug 12 16:02:57 PDT 2010


Author: stoklund
Date: Thu Aug 12 18:02:57 2010
New Revision: 110976

URL: http://llvm.org/viewvc/llvm-project?rev=110976&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/SplitKit.cpp

Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=110976&r1=110975&r2=110976&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SplitKit.cpp (original)
+++ llvm/trunk/lib/CodeGen/SplitKit.cpp Thu Aug 12 18:02:57 2010
@@ -674,8 +674,14 @@
 
   // 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.





More information about the llvm-commits mailing list