--corrected coalescing test: coalsed only if two are of the same reg class
authorRuchira Sasanka <sasanka@students.uiuc.edu>
Fri, 12 Oct 2001 17:48:18 +0000 (17:48 +0000)
committerRuchira Sasanka <sasanka@students.uiuc.edu>
Fri, 12 Oct 2001 17:48:18 +0000 (17:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@729 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp

index 4d3e925382acdaa2ca2a74625cb17831a0fd6fed..242b30cc57bd217ac6e1ce66e0710360c152dbb0 100644 (file)
@@ -110,6 +110,7 @@ void LiveRangeInfo::constructLiveRanges()
 
       // Now if the machine instruction has special operands that must be
       // set with a "suggested color", do it here.
+      // This will be true for call/return instructions
 
 
       if(  MRI.handleSpecialMInstr(MInst, *this, RegClassList) )
@@ -254,7 +255,7 @@ void LiveRangeInfo::coalesceLRs()
      for each machine instruction (inst)
        for each definition (def) in inst
          for each operand (op) of inst that is a use
-           if the def and op are of the same type
+           if the def and op are of the same register class
             if the def and op do not interfere //i.e., not simultaneously live
               if (degree(LR of def) + degree(LR of op)) <= # avail regs
                 if both LRs do not have suggested colors
@@ -313,12 +314,11 @@ void LiveRangeInfo::coalesceLRs()
            if( LROfUse == LROfDef)     // nothing to merge if they are same
              continue;
 
-           // RegClass *const RCOfUse = LROfUse->getRegClass();
+           RegClass *const RCOfUse = LROfUse->getRegClass();
 
-           //if( RCOfDef == RCOfUse ) {  // if the reg classes are the same
+           if( RCOfDef == RCOfUse ) {  // if the reg classes are the same
 
-
-           if( LROfUse->getTypeID() == LROfDef->getTypeID() ) { 
+             // if( LROfUse->getTypeID() == LROfDef->getTypeID() ) { 
 
              if( ! RCOfDef->getInterference(LROfDef, LROfUse) ) {
 
@@ -341,7 +341,7 @@ void LiveRangeInfo::coalesceLRs()
 
              } // if def and use do not interfere
 
-           } // if reg classes are the same
+           }// if reg classes are the same
 
          } // for all uses
 
index 4d3e925382acdaa2ca2a74625cb17831a0fd6fed..242b30cc57bd217ac6e1ce66e0710360c152dbb0 100644 (file)
@@ -110,6 +110,7 @@ void LiveRangeInfo::constructLiveRanges()
 
       // Now if the machine instruction has special operands that must be
       // set with a "suggested color", do it here.
+      // This will be true for call/return instructions
 
 
       if(  MRI.handleSpecialMInstr(MInst, *this, RegClassList) )
@@ -254,7 +255,7 @@ void LiveRangeInfo::coalesceLRs()
      for each machine instruction (inst)
        for each definition (def) in inst
          for each operand (op) of inst that is a use
-           if the def and op are of the same type
+           if the def and op are of the same register class
             if the def and op do not interfere //i.e., not simultaneously live
               if (degree(LR of def) + degree(LR of op)) <= # avail regs
                 if both LRs do not have suggested colors
@@ -313,12 +314,11 @@ void LiveRangeInfo::coalesceLRs()
            if( LROfUse == LROfDef)     // nothing to merge if they are same
              continue;
 
-           // RegClass *const RCOfUse = LROfUse->getRegClass();
+           RegClass *const RCOfUse = LROfUse->getRegClass();
 
-           //if( RCOfDef == RCOfUse ) {  // if the reg classes are the same
+           if( RCOfDef == RCOfUse ) {  // if the reg classes are the same
 
-
-           if( LROfUse->getTypeID() == LROfDef->getTypeID() ) { 
+             // if( LROfUse->getTypeID() == LROfDef->getTypeID() ) { 
 
              if( ! RCOfDef->getInterference(LROfDef, LROfUse) ) {
 
@@ -341,7 +341,7 @@ void LiveRangeInfo::coalesceLRs()
 
              } // if def and use do not interfere
 
-           } // if reg classes are the same
+           }// if reg classes are the same
 
          } // for all uses