Fix the sense of joinable
authorChris Lattner <sabre@nondot.org>
Sun, 25 Jul 2004 07:47:25 +0000 (07:47 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 25 Jul 2004 07:47:25 +0000 (07:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15196 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveInterval.cpp
lib/CodeGen/LiveIntervalAnalysis.cpp

index 532651110480f582005077d53d762ce05f6bb85a..6bd441f6431b4091fd15ed66f0ac7d1f0ed38fc7 100644 (file)
@@ -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;
 }
 
 
index 361210e106214a2a4f7283bdb39dd79e359da03c..ed90fca3df44744fd0aa708c3d390336d8f531e9 100644 (file)
@@ -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);