From: Chris Lattner Date: Sun, 25 Jul 2004 07:47:25 +0000 (+0000) Subject: Fix the sense of joinable X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c25b55a5b237772bbd7cc55988d3ca0ec569aede;hp=d67e4392412232a9aa5bf7560c0b0e624a842b65;p=oota-llvm.git Fix the sense of joinable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15196 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 53265111048..6bd441f6431 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -116,16 +116,16 @@ bool LiveInterval::joinable(const LiveInterval &other, unsigned CopyIdx) const { if (i->start == j->start) { // If this is not the allowed value merge, we cannot join. if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return true; + return false; } else if (i->start < j->start) { if (i->end > j->start) { if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return true; + return false; } } else { if (j->end > i->start) { if (i->ValId != ThisValIdx || j->ValId != OtherValIdx) - return true; + return false; } } if (i->end < j->end) @@ -134,7 +134,7 @@ bool LiveInterval::joinable(const LiveInterval &other, unsigned CopyIdx) const { ++j; } - return false; + return true; } diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 361210e1062..ed90fca3df4 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -577,7 +577,7 @@ void LiveIntervals::joinIntervalsInMachineBB(MachineBasicBlock *MBB) { IntA.containsOneValue() && IntB.containsOneValue(); unsigned MIDefIdx = getDefIndex(getInstructionIndex(mi)); - if ((TriviallyJoinable || !IntB.joinable(IntA, MIDefIdx)) && + if ((TriviallyJoinable || IntB.joinable(IntA, MIDefIdx)) && !overlapsAliases(&IntA, &IntB)) { IntB.join(IntA, MIDefIdx);