mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
* Code Cleanups
* Removal dependencies on Type.h & remove uses of getTypeID() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1718 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -327,7 +327,7 @@ void LiveRangeInfo::coalesceLRs()
|
||||
if( ! LROfUse ) { // if LR of use is not found
|
||||
|
||||
//don't warn about labels
|
||||
if (!((*UseI)->getType())->isLabelType() && DEBUG_RA)
|
||||
if (!isa<BasicBlock>(*UseI) && DEBUG_RA)
|
||||
cerr << " !! Warning: No LR for use " << RAV(*UseI) << "\n";
|
||||
continue; // ignore and continue
|
||||
}
|
||||
@@ -338,21 +338,19 @@ void LiveRangeInfo::coalesceLRs()
|
||||
//RegClass *const RCOfUse = LROfUse->getRegClass();
|
||||
//if( RCOfDef == RCOfUse ) { // if the reg classes are the same
|
||||
|
||||
if( MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse) ) {
|
||||
if (MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse)) {
|
||||
|
||||
// If the two RegTypes are the same
|
||||
|
||||
if( ! RCOfDef->getInterference(LROfDef, LROfUse) ) {
|
||||
if (!RCOfDef->getInterference(LROfDef, LROfUse) ) {
|
||||
|
||||
unsigned CombinedDegree =
|
||||
LROfDef->getUserIGNode()->getNumOfNeighbors() +
|
||||
LROfUse->getUserIGNode()->getNumOfNeighbors();
|
||||
|
||||
if( CombinedDegree <= RCOfDef->getNumOfAvailRegs() ) {
|
||||
|
||||
if (CombinedDegree <= RCOfDef->getNumOfAvailRegs()) {
|
||||
// if both LRs do not have suggested colors
|
||||
if( ! (LROfDef->hasSuggestedColor() &&
|
||||
LROfUse->hasSuggestedColor() ) ) {
|
||||
if (!(LROfDef->hasSuggestedColor() &&
|
||||
LROfUse->hasSuggestedColor())) {
|
||||
|
||||
RCOfDef->mergeIGNodesOfLRs(LROfDef, LROfUse);
|
||||
unionAndUpdateLRs(LROfDef, LROfUse);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/MachineFrameInfo.h"
|
||||
#include "llvm/Method.h"
|
||||
#include "llvm/Type.h"
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
using std::cerr;
|
||||
@@ -1164,22 +1165,19 @@ void PhyRegAlloc::markUnusableSugColors()
|
||||
// this method allocate a new spill position on the stack.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void PhyRegAlloc::allocateStackSpace4SpilledLRs()
|
||||
{
|
||||
if(DEBUG_RA ) cerr << "\nsetting LR stack offsets ...\n";
|
||||
void PhyRegAlloc::allocateStackSpace4SpilledLRs() {
|
||||
if (DEBUG_RA) cerr << "\nsetting LR stack offsets ...\n";
|
||||
|
||||
// hash map iterator
|
||||
LiveRangeMapType::const_iterator HMI = (LRI.getLiveRangeMap())->begin();
|
||||
LiveRangeMapType::const_iterator HMIEnd = (LRI.getLiveRangeMap())->end();
|
||||
LiveRangeMapType::const_iterator HMI = LRI.getLiveRangeMap()->begin();
|
||||
LiveRangeMapType::const_iterator HMIEnd = LRI.getLiveRangeMap()->end();
|
||||
|
||||
for( ; HMI != HMIEnd ; ++HMI ) {
|
||||
if(HMI->first && HMI->second) {
|
||||
LiveRange *L = HMI->second; // get the LiveRange
|
||||
if( ! L->hasColor() )
|
||||
// NOTE: ** allocating the size of long Type **
|
||||
L->setSpillOffFromFP(mcInfo.allocateSpilledValue(TM, Type::LongTy));
|
||||
}
|
||||
} // for all LR's in hash map
|
||||
for( ; HMI != HMIEnd ; ++HMI) {
|
||||
if (HMI->first && HMI->second) {
|
||||
LiveRange *L = HMI->second; // get the LiveRange
|
||||
if (!L->hasColor()) // NOTE: ** allocating the size of long Type **
|
||||
L->setSpillOffFromFP(mcInfo.allocateSpilledValue(TM, Type::LongTy));
|
||||
}
|
||||
} // for all LR's in hash map
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user