Go to the documentation of this file.
87 std::vector<DDGPass*> ddgPasses;
88 ddgPasses.push_back(ddgPass);
89 if (ddgPass != NULL) {
93 "must overload handleBasicBlock method!");
105 std::cerr <<
"Calling bbpass::executedgpass." << std::endl;
110 static int bbNumber = 0;
113 std::string name =
"scheduling";
118 ddgPasses[0]->handleDDG(*ddg, *rm, targetMachine);
121 std::string name =
"scheduling";
130 getenv(
"TCE_DUMP_LIVE_INFO") != NULL) {
134 <<
"liveinfo:" << bbNumber <<
":" << index + rm->
smallestCycle() <<
":"
157 assert(0 &&
"should not be here?");
177 static int bbCounter = 0;
182 (boost::format(
"bb_%.4d_1_after_%2%.dot") % bbCounter % name).str());
185 (boost::format(
"bb_%.4d_1_after_%2%.xml") % bbCounter % name).str());
191 (boost::format(
"bb_%.4d_0_before_%2%.dot") % bbCounter % name).str());
194 (boost::format(
"bb_%.4d_0_before_%2%.xml") % bbCounter % name).str());
219 if (lastCycle == -1) {
221 lastCycle = rmLastCycle;
227 std::cerr <<
"non-first has ref:, index: " << i <<
249 for (; index <= lastCycle; ++index) {
269 moveCount += newInstruction->
moveCount();
270 bb.
add(newInstruction);
274 << newInstruction->
toString() << std::endl;
283 const int instructionCount = lastCycle + 1 - rm.
smallestCycle();
286 const int moveSlotCount = busCount * instructionCount;
288 <<
"BB -- inner loop with trip count: " << bb.
tripCount()
290 <<
"BB -- instruction count: " << instructionCount << std::endl;
292 <<
"BB -- move slots used: " << moveCount <<
" of "
293 << moveSlotCount <<
" (" << (float)moveCount * 100 / moveSlotCount
294 <<
"%)" << std::endl;
virtual Instruction & firstInstruction() const
virtual TCEString name() const
virtual int largestCycle() const override
virtual int smallestCycle() const override
std::string toString() const
virtual DataDependenceGraphBuilder & ddgBuilder()
static int verboseLevel()
static std::ostream & logStream()
virtual bool executeLoopPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL)
virtual unsigned initiationInterval() const
std::set< TCEString > registersAlive(int cycle, int delaySlots, class DataDependenceGraph &ddg)
virtual ~BasicBlockPass()
#define assert(condition)
void writeToXMLFile(std::string fileName) const
virtual ControlUnit * controlUnit() const
#define abortWithError(message)
LiveRangeData * liveRangeData_
virtual int instructionCount() const
virtual void handleBasicBlock(TTAProgram::BasicBlock &basicBlock, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL)
virtual void executeDDGPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL)
virtual void add(Instruction *ins)
bool hasReference(Instruction &ins) const
void replace(Instruction &insA, Instruction &insB)
static void disposeRM(SimpleResourceManager *rm, bool allowReuse=true)
BasicBlockPass(InterPassData &data)
static void copyRMToBB(SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1)
static SimpleResourceManager * createRM(const TTAMachine::Machine &machine, unsigned int ii=0)
virtual void writeToDotFile(const TCEString &fileName) const
const TTAMachine::InstructionTemplate & instructionTemplate() const
unsigned tripCount() const
in case the BB is inside a loop and trip count is known, returns it, otherwise returns 0
virtual BusNavigator busNavigator() const
virtual DataDependenceGraph * build(ControlFlowGraph &cGraph, DataDependenceGraph::AntidependenceLevel antidependenceLevel, const TTAMachine::Machine &mach, const UniversalMachine *um=NULL, bool createMemAndFUDeps=true, bool createDeathInformation=true, llvm::AliasAnalysis *AA=NULL)
virtual void loseInstructionOwnership(int cycle)
virtual Instruction & instructionAtIndex(int index) const
bool hasControlFlowMove() const
void ddgSnapshot(DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final)
bool isInInnerLoop() const
returns true in case the BB is known to be inside an inner loop
virtual DataDependenceGraph * createDDGFromBB(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach)
virtual TTAProgram::Instruction * instruction(int cycle) const override