mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
* Add #includes removed from headers
* ValueSet interface converted from add/remove to insert/erase * Minor cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
#include "llvm/CodeGen/InterferenceGraph.h"
|
#include "llvm/CodeGen/InterferenceGraph.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -58,7 +58,7 @@ void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
|
|||||||
|
|
||||||
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
|
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
|
||||||
|
|
||||||
L1->add( *L2It ); // add the var in L2 to L1
|
L1->insert(*L2It); // add the var in L2 to L1
|
||||||
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
|
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
|
||||||
//to L1
|
//to L1
|
||||||
}
|
}
|
||||||
@ -105,11 +105,9 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
|
|
||||||
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
||||||
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
|
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
|
||||||
const Value *const Val = (const Value *) *ArgIt;
|
const Value *Val = (const Value *) *ArgIt;
|
||||||
|
|
||||||
assert( Val);
|
ArgRange->insert(Val); // add the arg (def) to it
|
||||||
|
|
||||||
ArgRange->add(Val); // add the arg (def) to it
|
|
||||||
LiveRangeMap[Val] = ArgRange;
|
LiveRangeMap[Val] = ArgRange;
|
||||||
|
|
||||||
// create a temp machine op to find the register class of value
|
// create a temp machine op to find the register class of value
|
||||||
@ -173,8 +171,8 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create a new LR iff this operand is a def
|
// create a new LR iff this operand is a def
|
||||||
if( OpI.isDef() ) {
|
if (OpI.isDef()) {
|
||||||
const Value *const Def = *OpI;
|
const Value *Def = *OpI;
|
||||||
|
|
||||||
// Only instruction values are accepted for live ranges here
|
// Only instruction values are accepted for live ranges here
|
||||||
if( Def->getValueType() != Value::InstructionVal ) {
|
if( Def->getValueType() != Value::InstructionVal ) {
|
||||||
@ -188,10 +186,10 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
// see LR already there (because of multiple defs)
|
// see LR already there (because of multiple defs)
|
||||||
if( !DefRange) { // if it is not in LiveRangeMap
|
if( !DefRange) { // if it is not in LiveRangeMap
|
||||||
DefRange = new LiveRange(); // creates a new live range and
|
DefRange = new LiveRange(); // creates a new live range and
|
||||||
DefRange->add( Def ); // add the instruction (def) to it
|
DefRange->insert(Def); // add the instruction (def) to it
|
||||||
LiveRangeMap[ Def ] = DefRange; // update the map
|
LiveRangeMap[ Def ] = DefRange; // update the map
|
||||||
|
|
||||||
if( DEBUG_RA > 1) {
|
if (DEBUG_RA > 1) {
|
||||||
cerr << " creating a LR for def: ";
|
cerr << " creating a LR for def: ";
|
||||||
printValue(Def); cerr << "\n";
|
printValue(Def); cerr << "\n";
|
||||||
}
|
}
|
||||||
@ -215,7 +213,7 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DefRange->add( Def ); // add the opearand to def range
|
DefRange->insert(Def); // add the opearand to def range
|
||||||
// update the map - Operand points
|
// update the map - Operand points
|
||||||
// to the merged set
|
// to the merged set
|
||||||
LiveRangeMap[ Def ] = DefRange;
|
LiveRangeMap[ Def ] = DefRange;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
|
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Target/MachineFrameInfo.h"
|
#include "llvm/Target/MachineFrameInfo.h"
|
||||||
|
#include "llvm/Method.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
@ -423,7 +424,7 @@ void PhyRegAlloc::addInterferencesForArgs()
|
|||||||
|
|
||||||
|
|
||||||
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
||||||
addInterference( *ArgIt, InSet, false ); // add interferences between
|
addInterference((Value*)*ArgIt, InSet, false); // add interferences between
|
||||||
// args and LVars at start
|
// args and LVars at start
|
||||||
if( DEBUG_RA > 1) {
|
if( DEBUG_RA > 1) {
|
||||||
cerr << " - %% adding interference for argument ";
|
cerr << " - %% adding interference for argument ";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "llvm/CodeGen/InterferenceGraph.h"
|
#include "llvm/CodeGen/InterferenceGraph.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -58,7 +58,7 @@ void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
|
|||||||
|
|
||||||
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
|
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
|
||||||
|
|
||||||
L1->add( *L2It ); // add the var in L2 to L1
|
L1->insert(*L2It); // add the var in L2 to L1
|
||||||
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
|
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
|
||||||
//to L1
|
//to L1
|
||||||
}
|
}
|
||||||
@ -105,11 +105,9 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
|
|
||||||
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
||||||
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
|
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
|
||||||
const Value *const Val = (const Value *) *ArgIt;
|
const Value *Val = (const Value *) *ArgIt;
|
||||||
|
|
||||||
assert( Val);
|
ArgRange->insert(Val); // add the arg (def) to it
|
||||||
|
|
||||||
ArgRange->add(Val); // add the arg (def) to it
|
|
||||||
LiveRangeMap[Val] = ArgRange;
|
LiveRangeMap[Val] = ArgRange;
|
||||||
|
|
||||||
// create a temp machine op to find the register class of value
|
// create a temp machine op to find the register class of value
|
||||||
@ -173,8 +171,8 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create a new LR iff this operand is a def
|
// create a new LR iff this operand is a def
|
||||||
if( OpI.isDef() ) {
|
if (OpI.isDef()) {
|
||||||
const Value *const Def = *OpI;
|
const Value *Def = *OpI;
|
||||||
|
|
||||||
// Only instruction values are accepted for live ranges here
|
// Only instruction values are accepted for live ranges here
|
||||||
if( Def->getValueType() != Value::InstructionVal ) {
|
if( Def->getValueType() != Value::InstructionVal ) {
|
||||||
@ -188,10 +186,10 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
// see LR already there (because of multiple defs)
|
// see LR already there (because of multiple defs)
|
||||||
if( !DefRange) { // if it is not in LiveRangeMap
|
if( !DefRange) { // if it is not in LiveRangeMap
|
||||||
DefRange = new LiveRange(); // creates a new live range and
|
DefRange = new LiveRange(); // creates a new live range and
|
||||||
DefRange->add( Def ); // add the instruction (def) to it
|
DefRange->insert(Def); // add the instruction (def) to it
|
||||||
LiveRangeMap[ Def ] = DefRange; // update the map
|
LiveRangeMap[ Def ] = DefRange; // update the map
|
||||||
|
|
||||||
if( DEBUG_RA > 1) {
|
if (DEBUG_RA > 1) {
|
||||||
cerr << " creating a LR for def: ";
|
cerr << " creating a LR for def: ";
|
||||||
printValue(Def); cerr << "\n";
|
printValue(Def); cerr << "\n";
|
||||||
}
|
}
|
||||||
@ -215,7 +213,7 @@ void LiveRangeInfo::constructLiveRanges()
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DefRange->add( Def ); // add the opearand to def range
|
DefRange->insert(Def); // add the opearand to def range
|
||||||
// update the map - Operand points
|
// update the map - Operand points
|
||||||
// to the merged set
|
// to the merged set
|
||||||
LiveRangeMap[ Def ] = DefRange;
|
LiveRangeMap[ Def ] = DefRange;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
|
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Target/MachineFrameInfo.h"
|
#include "llvm/Target/MachineFrameInfo.h"
|
||||||
|
#include "llvm/Method.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
@ -423,7 +424,7 @@ void PhyRegAlloc::addInterferencesForArgs()
|
|||||||
|
|
||||||
|
|
||||||
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
|
||||||
addInterference( *ArgIt, InSet, false ); // add interferences between
|
addInterference((Value*)*ArgIt, InSet, false); // add interferences between
|
||||||
// args and LVars at start
|
// args and LVars at start
|
||||||
if( DEBUG_RA > 1) {
|
if( DEBUG_RA > 1) {
|
||||||
cerr << " - %% adding interference for argument ";
|
cerr << " - %% adding interference for argument ";
|
||||||
|
Reference in New Issue
Block a user