From efaf9be8a44eb4c52981009ae8eb2a1e8af5fab6 Mon Sep 17 00:00:00 2001 From: Ruchira Sasanka Date: Sat, 10 Nov 2001 00:20:24 +0000 Subject: [PATCH] Coalesing bug fix - now checks for the same regType instead of the same regClass since FP class has two reg Types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1236 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAlloc/LiveRangeInfo.cpp | 9 ++++++--- lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp index a4c3aabe101..c07227539a2 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp @@ -253,7 +253,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 register class + if the def and op are of the same register type 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 @@ -312,9 +312,12 @@ 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( MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse) ) { + + // If the two RegTypes are the same if( ! RCOfDef->getInterference(LROfDef, LROfUse) ) { diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp index a4c3aabe101..c07227539a2 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp @@ -253,7 +253,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 register class + if the def and op are of the same register type 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 @@ -312,9 +312,12 @@ 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( MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse) ) { + + // If the two RegTypes are the same if( ! RCOfDef->getInterference(LROfDef, LROfUse) ) {