mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
change the include file names and some class names to make it compile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <swig.h>
|
//#include <swig.h>
|
||||||
#include "llvm/iOperators.h"
|
#include "llvm/iOperators.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/Target/MachineSchedInfo.h"
|
#include "llvm/Target/TargetSchedInfo.h"
|
||||||
|
|
||||||
#define UNIDELAY 1
|
#define UNIDELAY 1
|
||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
@ -104,7 +104,8 @@ bool isDefinition(const Instruction* I)
|
|||||||
void ModuloSchedGraph::addDefUseEdges(const BasicBlock* bb)
|
void ModuloSchedGraph::addDefUseEdges(const BasicBlock* bb)
|
||||||
{
|
{
|
||||||
//collect def instructions, store them in vector
|
//collect def instructions, store them in vector
|
||||||
const MachineInstrInfo& mii = target.getInstrInfo();
|
// const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
|
const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
|
|
||||||
typedef std::vector<ModuloSchedGraphNode*> DefVec;
|
typedef std::vector<ModuloSchedGraphNode*> DefVec;
|
||||||
DefVec defVec;
|
DefVec defVec;
|
||||||
@ -274,7 +275,7 @@ void ModuloSchedGraph::buildNodesforBB (const TargetMachine& target,
|
|||||||
RegToRefVecMap& regToRefVecMap,
|
RegToRefVecMap& regToRefVecMap,
|
||||||
ValueToDefVecMap& valueToDefVecMap)
|
ValueToDefVecMap& valueToDefVecMap)
|
||||||
{
|
{
|
||||||
//const MachineInstrInfo& mii=target.getInstrInfo();
|
//const TargetInstrInfo& mii=target.getInstrInfo();
|
||||||
|
|
||||||
//Build graph nodes for each LLVM instruction and gather def/use info.
|
//Build graph nodes for each LLVM instruction and gather def/use info.
|
||||||
//Do both together in a single pass over all machine instructions.
|
//Do both together in a single pass over all machine instructions.
|
||||||
@ -889,7 +890,7 @@ void ModuloSchedGraph::buildGraph (const TargetMachine& target)
|
|||||||
this->dump(bb);
|
this->dump(bb);
|
||||||
|
|
||||||
if(!isLoop(bb)){
|
if(!isLoop(bb)){
|
||||||
modSched_os <<" dumping non-loop BB:"<<endl;
|
modSched_os <<" dumping non-loop BB:\n";
|
||||||
dump(bb);
|
dump(bb);
|
||||||
}
|
}
|
||||||
if( isLoop(bb))
|
if( isLoop(bb))
|
||||||
@ -1109,7 +1110,7 @@ void ModuloSchedGraph::addResourceUsage(std::vector<pair<int,int> >& ruVec, int
|
|||||||
}
|
}
|
||||||
void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
||||||
{
|
{
|
||||||
MachineSchedInfo& msi = (MachineSchedInfo&)target.getSchedInfo();
|
TargetSchedInfo& msi = (TargetSchedInfo&)target.getSchedInfo();
|
||||||
|
|
||||||
std::vector<pair<int,int> > resourceNumVector = msi.resourceNumVector;
|
std::vector<pair<int,int> > resourceNumVector = msi.resourceNumVector;
|
||||||
modSched_os <<"resourceID\t"<<"resourceNum"<<"\n";
|
modSched_os <<"resourceID\t"<<"resourceNum"<<"\n";
|
||||||
@ -1128,8 +1129,8 @@ void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
|||||||
int ModuloSchedGraph::computeResII(const BasicBlock* bb)
|
int ModuloSchedGraph::computeResII(const BasicBlock* bb)
|
||||||
{
|
{
|
||||||
|
|
||||||
const MachineInstrInfo& mii = target.getInstrInfo();
|
const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
const MachineSchedInfo& msi = target.getSchedInfo();
|
const TargetSchedInfo& msi = target.getSchedInfo();
|
||||||
|
|
||||||
int ResII;
|
int ResII;
|
||||||
std::vector<pair<int,int> > resourceUsage; //pair<int resourceid, int resourceUsageTimes_in_the_whole_block>
|
std::vector<pair<int,int> > resourceUsage; //pair<int resourceid, int resourceUsageTimes_in_the_whole_block>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "../InstrSched/SchedGraphCommon.h"
|
#include "../InstrSched/SchedGraphCommon.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::pair;
|
using std::pair;
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
|
//#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
//#include "llvm/CodeGen/MachineCodeForMethod.h"
|
||||||
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
|
//#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
@ -18,13 +19,13 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "ModuloSchedGraph.h"
|
#include "ModuloSchedGraph.h"
|
||||||
#include "ModuloScheduling.h"
|
#include "ModuloScheduling.h"
|
||||||
#include "llvm/Target/MachineSchedInfo.h"
|
#include "llvm/Target/TargetSchedInfo.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <swig.h>
|
//#include <swig.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "llvm/CodeGen/InstrSelection.h"
|
#include "llvm/CodeGen/InstrSelection.h"
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ void ModuloScheduling::instrScheduling(){
|
|||||||
modSched_os<<"*************************computing modulo schedule ************************\n";
|
modSched_os<<"*************************computing modulo schedule ************************\n";
|
||||||
|
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
|
|
||||||
//number of issue slots in the in each cycle
|
//number of issue slots in the in each cycle
|
||||||
int numIssueSlots=msi.maxNumIssueTotal;
|
int numIssueSlots=msi.maxNumIssueTotal;
|
||||||
@ -137,13 +138,13 @@ void ModuloScheduling::instrScheduling(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//clear memory from the last round and initialize if necessary
|
//clear memory from the last round and initialize if necessary
|
||||||
void ModuloScheduling::clearInitMem(const MachineSchedInfo& msi){
|
void ModuloScheduling::clearInitMem(const TargetSchedInfo& msi){
|
||||||
|
|
||||||
|
|
||||||
unsigned numIssueSlots = msi.maxNumIssueTotal;
|
unsigned numIssueSlots = msi.maxNumIssueTotal;
|
||||||
//clear nodeScheduled from the last round
|
//clear nodeScheduled from the last round
|
||||||
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess){
|
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess){
|
||||||
modSched_os<< "***** new round with II= "<<II<<" *******************"<<endl;
|
modSched_os<< "***** new round with II= "<<II<<" *******************"<<"\n";
|
||||||
modSched_os<< " **************clear the vector nodeScheduled**************** \n";
|
modSched_os<< " **************clear the vector nodeScheduled**************** \n";
|
||||||
}
|
}
|
||||||
nodeScheduled.clear();
|
nodeScheduled.clear();
|
||||||
@ -602,7 +603,7 @@ Instruction* ModuloScheduling::cloneInstSetMemory(Instruction* orn) {
|
|||||||
bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, unsigned end, NodeVec& nodeScheduled)
|
bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, unsigned end, NodeVec& nodeScheduled)
|
||||||
{
|
{
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned int numIssueSlots=msi.maxNumIssueTotal;
|
unsigned int numIssueSlots=msi.maxNumIssueTotal;
|
||||||
|
|
||||||
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess)
|
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess)
|
||||||
@ -620,7 +621,7 @@ bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, u
|
|||||||
const Instruction* instr=node->getInst();
|
const Instruction* instr=node->getInst();
|
||||||
MachineCodeForInstruction& tempMvec= MachineCodeForInstruction::get(instr);
|
MachineCodeForInstruction& tempMvec= MachineCodeForInstruction::get(instr);
|
||||||
bool resourceConflict=false;
|
bool resourceConflict=false;
|
||||||
const MachineInstrInfo &mii=msi.getInstrInfo();
|
const TargetInstrInfo &mii=msi.getInstrInfo();
|
||||||
|
|
||||||
if(coreSchedule.size() < core_i+1 || !coreSchedule[core_i][core_j]){
|
if(coreSchedule.size() < core_i+1 || !coreSchedule[core_i][core_j]){
|
||||||
//this->dumpResourceUsageTable();
|
//this->dumpResourceUsageTable();
|
||||||
@ -784,7 +785,7 @@ void ModuloScheduling::dumpResourceUsageTable(){
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNode*> > thisSchedule){
|
void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNode*> > thisSchedule){
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
||||||
for(unsigned i=0;i< numIssueSlots;i++)
|
for(unsigned i=0;i< numIssueSlots;i++)
|
||||||
modSched_os <<"\t#";
|
modSched_os <<"\t#";
|
||||||
@ -812,7 +813,7 @@ void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNod
|
|||||||
|
|
||||||
void ModuloScheduling::dumpScheduling(){
|
void ModuloScheduling::dumpScheduling(){
|
||||||
modSched_os<<"dump schedule:"<<"\n";
|
modSched_os<<"dump schedule:"<<"\n";
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
||||||
for(unsigned i=0;i< numIssueSlots;i++)
|
for(unsigned i=0;i< numIssueSlots;i++)
|
||||||
modSched_os <<"\t#";
|
modSched_os <<"\t#";
|
||||||
@ -880,7 +881,7 @@ bool ModuloSchedulingPass::runOnFunction(Function &F)
|
|||||||
|
|
||||||
if(ModuloSchedDebugLevel>= ModuloSched_PrintSchedule){
|
if(ModuloSchedDebugLevel>= ModuloSched_PrintSchedule){
|
||||||
modSched_fb.open("moduloSchedDebugInfo.output", ios::out);
|
modSched_fb.open("moduloSchedDebugInfo.output", ios::out);
|
||||||
modSched_os<<"******************Modula Scheduling debug information*************************"<<endl;
|
modSched_os<<"******************Modula Scheduling debug information*************************"<<"\n ";
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuloSchedGraphSet* graphSet = new ModuloSchedGraphSet(&F,target);
|
ModuloSchedGraphSet* graphSet = new ModuloSchedGraphSet(&F,target);
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
#include "ModuloSchedGraph.h"
|
#include "ModuloSchedGraph.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class ModuloScheduling:NonCopyable {
|
class ModuloScheduling:NonCopyable {
|
||||||
private:
|
private:
|
||||||
@ -82,7 +85,7 @@ public:
|
|||||||
//*******************internel functions*******************************
|
//*******************internel functions*******************************
|
||||||
private:
|
private:
|
||||||
//clear memory from the last round and initialize if necessary
|
//clear memory from the last round and initialize if necessary
|
||||||
void clearInitMem(const MachineSchedInfo& );
|
void clearInitMem(const TargetSchedInfo& );
|
||||||
|
|
||||||
//compute schedule and coreSchedule with the current II
|
//compute schedule and coreSchedule with the current II
|
||||||
bool computeSchedule();
|
bool computeSchedule();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <swig.h>
|
//#include <swig.h>
|
||||||
#include "llvm/iOperators.h"
|
#include "llvm/iOperators.h"
|
||||||
#include "llvm/iOther.h"
|
#include "llvm/iOther.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/Target/MachineSchedInfo.h"
|
#include "llvm/Target/TargetSchedInfo.h"
|
||||||
|
|
||||||
#define UNIDELAY 1
|
#define UNIDELAY 1
|
||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
@ -104,7 +104,8 @@ bool isDefinition(const Instruction* I)
|
|||||||
void ModuloSchedGraph::addDefUseEdges(const BasicBlock* bb)
|
void ModuloSchedGraph::addDefUseEdges(const BasicBlock* bb)
|
||||||
{
|
{
|
||||||
//collect def instructions, store them in vector
|
//collect def instructions, store them in vector
|
||||||
const MachineInstrInfo& mii = target.getInstrInfo();
|
// const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
|
const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
|
|
||||||
typedef std::vector<ModuloSchedGraphNode*> DefVec;
|
typedef std::vector<ModuloSchedGraphNode*> DefVec;
|
||||||
DefVec defVec;
|
DefVec defVec;
|
||||||
@ -274,7 +275,7 @@ void ModuloSchedGraph::buildNodesforBB (const TargetMachine& target,
|
|||||||
RegToRefVecMap& regToRefVecMap,
|
RegToRefVecMap& regToRefVecMap,
|
||||||
ValueToDefVecMap& valueToDefVecMap)
|
ValueToDefVecMap& valueToDefVecMap)
|
||||||
{
|
{
|
||||||
//const MachineInstrInfo& mii=target.getInstrInfo();
|
//const TargetInstrInfo& mii=target.getInstrInfo();
|
||||||
|
|
||||||
//Build graph nodes for each LLVM instruction and gather def/use info.
|
//Build graph nodes for each LLVM instruction and gather def/use info.
|
||||||
//Do both together in a single pass over all machine instructions.
|
//Do both together in a single pass over all machine instructions.
|
||||||
@ -889,7 +890,7 @@ void ModuloSchedGraph::buildGraph (const TargetMachine& target)
|
|||||||
this->dump(bb);
|
this->dump(bb);
|
||||||
|
|
||||||
if(!isLoop(bb)){
|
if(!isLoop(bb)){
|
||||||
modSched_os <<" dumping non-loop BB:"<<endl;
|
modSched_os <<" dumping non-loop BB:\n";
|
||||||
dump(bb);
|
dump(bb);
|
||||||
}
|
}
|
||||||
if( isLoop(bb))
|
if( isLoop(bb))
|
||||||
@ -1109,7 +1110,7 @@ void ModuloSchedGraph::addResourceUsage(std::vector<pair<int,int> >& ruVec, int
|
|||||||
}
|
}
|
||||||
void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
||||||
{
|
{
|
||||||
MachineSchedInfo& msi = (MachineSchedInfo&)target.getSchedInfo();
|
TargetSchedInfo& msi = (TargetSchedInfo&)target.getSchedInfo();
|
||||||
|
|
||||||
std::vector<pair<int,int> > resourceNumVector = msi.resourceNumVector;
|
std::vector<pair<int,int> > resourceNumVector = msi.resourceNumVector;
|
||||||
modSched_os <<"resourceID\t"<<"resourceNum"<<"\n";
|
modSched_os <<"resourceID\t"<<"resourceNum"<<"\n";
|
||||||
@ -1128,8 +1129,8 @@ void ModuloSchedGraph::dumpResourceUsage(std::vector< pair<int,int> > &ru)
|
|||||||
int ModuloSchedGraph::computeResII(const BasicBlock* bb)
|
int ModuloSchedGraph::computeResII(const BasicBlock* bb)
|
||||||
{
|
{
|
||||||
|
|
||||||
const MachineInstrInfo& mii = target.getInstrInfo();
|
const TargetInstrInfo& mii = target.getInstrInfo();
|
||||||
const MachineSchedInfo& msi = target.getSchedInfo();
|
const TargetSchedInfo& msi = target.getSchedInfo();
|
||||||
|
|
||||||
int ResII;
|
int ResII;
|
||||||
std::vector<pair<int,int> > resourceUsage; //pair<int resourceid, int resourceUsageTimes_in_the_whole_block>
|
std::vector<pair<int,int> > resourceUsage; //pair<int resourceid, int resourceUsageTimes_in_the_whole_block>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "../InstrSched/SchedGraphCommon.h"
|
#include "../InstrSched/SchedGraphCommon.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using std::pair;
|
using std::pair;
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
#include "llvm/CodeGen/MachineInstr.h"
|
#include "llvm/CodeGen/MachineInstr.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
#include "llvm/CodeGen/MachineCodeForInstruction.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
|
//#include "llvm/CodeGen/MachineCodeForBasicBlock.h"
|
||||||
#include "llvm/CodeGen/MachineCodeForMethod.h"
|
//#include "llvm/CodeGen/MachineCodeForMethod.h"
|
||||||
#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
|
//#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/Instruction.h"
|
#include "llvm/Instruction.h"
|
||||||
@ -18,13 +19,13 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "ModuloSchedGraph.h"
|
#include "ModuloSchedGraph.h"
|
||||||
#include "ModuloScheduling.h"
|
#include "ModuloScheduling.h"
|
||||||
#include "llvm/Target/MachineSchedInfo.h"
|
#include "llvm/Target/TargetSchedInfo.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/iTerminators.h"
|
#include "llvm/iTerminators.h"
|
||||||
#include "llvm/iPHINode.h"
|
#include "llvm/iPHINode.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <swig.h>
|
//#include <swig.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "llvm/CodeGen/InstrSelection.h"
|
#include "llvm/CodeGen/InstrSelection.h"
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ void ModuloScheduling::instrScheduling(){
|
|||||||
modSched_os<<"*************************computing modulo schedule ************************\n";
|
modSched_os<<"*************************computing modulo schedule ************************\n";
|
||||||
|
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
|
|
||||||
//number of issue slots in the in each cycle
|
//number of issue slots in the in each cycle
|
||||||
int numIssueSlots=msi.maxNumIssueTotal;
|
int numIssueSlots=msi.maxNumIssueTotal;
|
||||||
@ -137,13 +138,13 @@ void ModuloScheduling::instrScheduling(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//clear memory from the last round and initialize if necessary
|
//clear memory from the last round and initialize if necessary
|
||||||
void ModuloScheduling::clearInitMem(const MachineSchedInfo& msi){
|
void ModuloScheduling::clearInitMem(const TargetSchedInfo& msi){
|
||||||
|
|
||||||
|
|
||||||
unsigned numIssueSlots = msi.maxNumIssueTotal;
|
unsigned numIssueSlots = msi.maxNumIssueTotal;
|
||||||
//clear nodeScheduled from the last round
|
//clear nodeScheduled from the last round
|
||||||
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess){
|
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess){
|
||||||
modSched_os<< "***** new round with II= "<<II<<" *******************"<<endl;
|
modSched_os<< "***** new round with II= "<<II<<" *******************"<<"\n";
|
||||||
modSched_os<< " **************clear the vector nodeScheduled**************** \n";
|
modSched_os<< " **************clear the vector nodeScheduled**************** \n";
|
||||||
}
|
}
|
||||||
nodeScheduled.clear();
|
nodeScheduled.clear();
|
||||||
@ -602,7 +603,7 @@ Instruction* ModuloScheduling::cloneInstSetMemory(Instruction* orn) {
|
|||||||
bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, unsigned end, NodeVec& nodeScheduled)
|
bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, unsigned end, NodeVec& nodeScheduled)
|
||||||
{
|
{
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned int numIssueSlots=msi.maxNumIssueTotal;
|
unsigned int numIssueSlots=msi.maxNumIssueTotal;
|
||||||
|
|
||||||
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess)
|
if( ModuloSchedDebugLevel >= ModuloSched_PrintScheduleProcess)
|
||||||
@ -620,7 +621,7 @@ bool ModuloScheduling::ScheduleNode(ModuloSchedGraphNode* node,unsigned start, u
|
|||||||
const Instruction* instr=node->getInst();
|
const Instruction* instr=node->getInst();
|
||||||
MachineCodeForInstruction& tempMvec= MachineCodeForInstruction::get(instr);
|
MachineCodeForInstruction& tempMvec= MachineCodeForInstruction::get(instr);
|
||||||
bool resourceConflict=false;
|
bool resourceConflict=false;
|
||||||
const MachineInstrInfo &mii=msi.getInstrInfo();
|
const TargetInstrInfo &mii=msi.getInstrInfo();
|
||||||
|
|
||||||
if(coreSchedule.size() < core_i+1 || !coreSchedule[core_i][core_j]){
|
if(coreSchedule.size() < core_i+1 || !coreSchedule[core_i][core_j]){
|
||||||
//this->dumpResourceUsageTable();
|
//this->dumpResourceUsageTable();
|
||||||
@ -784,7 +785,7 @@ void ModuloScheduling::dumpResourceUsageTable(){
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNode*> > thisSchedule){
|
void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNode*> > thisSchedule){
|
||||||
|
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
||||||
for(unsigned i=0;i< numIssueSlots;i++)
|
for(unsigned i=0;i< numIssueSlots;i++)
|
||||||
modSched_os <<"\t#";
|
modSched_os <<"\t#";
|
||||||
@ -812,7 +813,7 @@ void ModuloScheduling::dumpSchedule(std::vector< std::vector<ModuloSchedGraphNod
|
|||||||
|
|
||||||
void ModuloScheduling::dumpScheduling(){
|
void ModuloScheduling::dumpScheduling(){
|
||||||
modSched_os<<"dump schedule:"<<"\n";
|
modSched_os<<"dump schedule:"<<"\n";
|
||||||
const MachineSchedInfo& msi=target.getSchedInfo();
|
const TargetSchedInfo& msi=target.getSchedInfo();
|
||||||
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
unsigned numIssueSlots=msi.maxNumIssueTotal;
|
||||||
for(unsigned i=0;i< numIssueSlots;i++)
|
for(unsigned i=0;i< numIssueSlots;i++)
|
||||||
modSched_os <<"\t#";
|
modSched_os <<"\t#";
|
||||||
@ -880,7 +881,7 @@ bool ModuloSchedulingPass::runOnFunction(Function &F)
|
|||||||
|
|
||||||
if(ModuloSchedDebugLevel>= ModuloSched_PrintSchedule){
|
if(ModuloSchedDebugLevel>= ModuloSched_PrintSchedule){
|
||||||
modSched_fb.open("moduloSchedDebugInfo.output", ios::out);
|
modSched_fb.open("moduloSchedDebugInfo.output", ios::out);
|
||||||
modSched_os<<"******************Modula Scheduling debug information*************************"<<endl;
|
modSched_os<<"******************Modula Scheduling debug information*************************"<<"\n ";
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuloSchedGraphSet* graphSet = new ModuloSchedGraphSet(&F,target);
|
ModuloSchedGraphSet* graphSet = new ModuloSchedGraphSet(&F,target);
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
|
|
||||||
#include "ModuloSchedGraph.h"
|
#include "ModuloSchedGraph.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class ModuloScheduling:NonCopyable {
|
class ModuloScheduling:NonCopyable {
|
||||||
private:
|
private:
|
||||||
@ -82,7 +85,7 @@ public:
|
|||||||
//*******************internel functions*******************************
|
//*******************internel functions*******************************
|
||||||
private:
|
private:
|
||||||
//clear memory from the last round and initialize if necessary
|
//clear memory from the last round and initialize if necessary
|
||||||
void clearInitMem(const MachineSchedInfo& );
|
void clearInitMem(const TargetSchedInfo& );
|
||||||
|
|
||||||
//compute schedule and coreSchedule with the current II
|
//compute schedule and coreSchedule with the current II
|
||||||
bool computeSchedule();
|
bool computeSchedule();
|
||||||
|
Reference in New Issue
Block a user