From: David Greene Date: Wed, 22 Jul 2009 22:32:19 +0000 (+0000) Subject: Reorder if-else branches as suggested by Bill. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92b78bbc7f2ee919a2d09ed00fd35d1eb7f5f548;p=oota-llvm.git Reorder if-else branches as suggested by Bill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76808 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 04281055510..c8d3d43e520 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -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