Reorder if-else branches as suggested by Bill.
authorDavid Greene <greened@obbligato.org>
Wed, 22 Jul 2009 22:32:19 +0000 (22:32 +0000)
committerDavid Greene <greened@obbligato.org>
Wed, 22 Jul 2009 22:32:19 +0000 (22:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76808 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp

index 0428105551064541dd6eea7da9436ef9d9fa92af..c8d3d43e520d81d907531d91838c86cf44ee3ff6 100644 (file)
@@ -800,15 +800,15 @@ void LiveInterval::ComputeJoinedWeight(const LiveInterval &Other) {
   // weight of the non-spilled interval.  This can only happen with
   // iterative coalescers.
 
-  if (weight == HUGE_VALF &&
+  if (Other.weight != HUGE_VALF) {
+    weight += Other.weight;
+  }
+  else if (weight == HUGE_VALF &&
       !TargetRegisterInfo::isPhysicalRegister(reg)) {
     // Remove this assert if you have an iterative coalescer
     assert(0 && "Joining to spilled interval");
     weight = Other.weight;
   }
-  else if (Other.weight != HUGE_VALF) {
-    weight += Other.weight;
-  }
   else {
     // Otherwise the weight stays the same
     // Remove this assert if you have an iterative coalescer