OpenASIP 2.2
Loading...
Searching...
No Matches
BBSchedulerController.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2020 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file BBSchedulerController.cc
26 *
27 * Definition of BBSchedulerController class.
28 *
29 * @author Pekka Jääskeläinen 2006-2011 (pjaaskel-no.spam-cs.tut.fi)
30 * @author Heikki Kultala 2009 (hkultala-no.spam-cs.tut.fi)
31 * @note rating: red
32 */
33
34#include <set>
35#include <string>
36#include <cstdlib>
37
39#include "ControlFlowGraph.hh"
43#include "Procedure.hh"
44#include "ControlUnit.hh"
45#include "Machine.hh"
46#include "Instruction.hh"
47#include "BasicBlock.hh"
49#include "SchedulerPass.hh"
50#include "SoftwareBypasser.hh"
52#include "Program.hh"
53#include "TCEString.hh"
54#include "Application.hh"
59#include "InterPassData.hh"
62#include "RegisterRenamer.hh"
64#include "BF2Scheduler.hh"
66
67#include "LoopAnalyzer.hh"
68#include "ScheduleEstimator.hh"
69
70namespace TTAMachine {
71 class UniversalMachine;
72}
73
74//#define DEBUG_OUTPUT
75//#define CFG_SNAPSHOTS
76//#define BIG_DDG_SNAPSHOTS
77//#define SW_BYPASSING_STATISTICS
78
79// getting slow with very big II's. limit it. TODO: make this cmdline param.
80static const int MAXIMUM_II = 60;
81static const int DEFAULT_LOWMEM_MODE_THRESHOLD = 200000;
82
83/**
84 * Constructs the basic block scheduler.
85 *
86 * @param data Interpass data
87 * @param bypasser Helper module implementing software bypassing
88 * @param delaySlotFiller Helper module implementing jump delay slot filling
89 */
91 const TTAMachine::Machine& targetMachine, InterPassData& data,
92 SoftwareBypasser* bypasser, CopyingDelaySlotFiller* delaySlotFiller,
93 DataDependenceGraph* bigDDG)
94 : BasicBlockPass(data),
96 ProcedurePass(data),
97 ProgramPass(data),
98 targetMachine_(targetMachine),
99 scheduledProcedure_(NULL),
100 bigDDG_(bigDDG),
101 softwareBypasser_(bypasser),
102 delaySlotFiller_(delaySlotFiller),
103 basicBlocksScheduled_(0),
104 totalBasicBlocks_(0) {
106 options_ = dynamic_cast<LLVMTCECmdLineOptions*>(cmdLineOptions);
107}
108
111
112/**
113 * Schedules a single basic block.
114 *
115 * @param bb The basic block to schedule.
116 * @param targetMachine The target machine.
117 * @exception Exception several TCE exceptions can be thrown in case of
118 * a scheduling error.
119 */
120void
122 TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
124 // TODO: define them somewhere in one place.
125 static const TCEString SP_DATUM = "STACK_POINTER";
126 static const TCEString FP_DATUM = "FRAME_POINTER";
127 static const TCEString RV_DATUM = "RV_REGISTER";
128 // high part of 64-bit return values.
129 static const TCEString RV_HIGH_DATUM = "RV_HIGH_REGISTER";
130
131 if (bb.instructionCount() == 0)
132 return;
133
134 bool bbScheduled = false;
135
136 RegisterRenamer* rr = NULL;
137
139 dynamic_cast<SchedulerCmdLineOptions*>(
141
142 // create register renamer if enabled and we know the
143 // reserved registers.
144 if (options != NULL && options->renameRegisters() && bigDDG_ != NULL
149 rr = new RegisterRenamer(targetMachine, bbn->basicBlock());
150 }
151
152 std::vector<DDGPass*> bbSchedulers;
153
154 if (options_ != NULL && options_->useBubbleFish2Scheduler()) {
155 bbSchedulers.push_back(new BF2Scheduler(
157 } else if (options_ != NULL && options_->useBUScheduler()) {
158 bbSchedulers.push_back(new BUBasicBlockScheduler(
160 } else if (options_ != NULL && options_->useTDScheduler()) {
161 bbSchedulers.push_back(new BasicBlockScheduler(
163 } else {
164 bbSchedulers.push_back(new BF2Scheduler(
166 }
167
168 if (options_->isLoopOptDefined() &&
169 cfg_->isSingleBBLoop(*bbn) &&
170 bb.lastInstruction().hasJump() &&
171 bigDDG_ != NULL) {
172
173 LoopAnalyzer::LoopAnalysisResult* analysis = NULL;
174 if (Application::verboseLevel() > 1) {
176 << "CFG detects single BB loop" << std::endl
177 << "tripcount: " << bb.tripCount() << std::endl;
178 }
179 if (bigDDG_ && bb.tripCount() == 0 && options_->useBubbleFish2Scheduler()) {
180 analysis = LoopAnalyzer::analyze(*bbn, *bigDDG_);
181 if (analysis != NULL) {
182 bb.setTripCount(analysis->iterationCount);
183 if (analysis->counterValueNode == NULL) {
184 if (Application::verboseLevel() > 1) {
186 << "loop analyzis analyzed loop to have fixed trip count"
187 << analysis->iterationCount << std::endl;
188 }
189 } else {
190 if (Application::verboseLevel() > 1) {
192 << "loop analyzis analyzed loop to have variable trip count"
193 << analysis->counterValueNode->toString()
194 << " + "
195 << analysis->iterationCount << " divided by"
196 << analysis->counterMultiplier << std::endl;
197 }
198 }
199 }
200 }
201
202 if ((((bb.tripCount() > 0 || (analysis && analysis->counterValueNode)) &&
203 MachineConnectivityCheck::tempRegisterFiles(targetMachine).empty()) ||
205 if (analysis) {
206 (static_cast<BF2Scheduler*>(bbSchedulers[0]))->
207 setLoopLimits(analysis);
208 }
209 // software pipeline instead of calling the flat BB scheduler
210 if (Application::verboseLevel() > 1) {
212 << "executing loop pass with trip count " << bb.tripCount()
213 << std::endl;
214 }
215
216 if (executeLoopPass(
217 bb, targetMachine, irm, bbSchedulers, bbn) ) {
218 bbScheduled = true;
219 } else {
220 if (Application::verboseLevel() > 1) {
222 << "loop scheduler failed, using basic block "
223 << "scheduler instead" << std::endl;
224 }
225 bbScheduled = false;
226 }
227 }
228 // if not scheduled yet (or loop scheduling failed)
229 }
230 if (!bbScheduled) {
231
233 bb, targetMachine, irm, bbSchedulers, bbn);
234
236 }
237 if (rr != NULL) {
238 delete rr;
239 }
240
241 // these are no longer needed. delete them to save memory.
242 if (bb.liveRangeData_ != NULL) {
244 bb.liveRangeData_->regDefines_.clear();
245 bb.liveRangeData_->regLastUses_.clear();
246
247 bb.liveRangeData_->regDefReaches_.clear();
249 bb.liveRangeData_->regFirstUses_.clear();
250 bb.liveRangeData_->regDefines_.clear();
251 } else {
252 std::cerr << "Wargning: BB liverange data null for: "
253 << bbn->toString() << std::endl;
254 }
255 for (unsigned int i = 0; i < bbSchedulers.size(); i++)
256 delete bbSchedulers[i];
257}
258
259#ifdef DEBUG_REG_COPY_ADDER
260static int graphCount = 0;
261#endif
262
263/**
264 * Schedules a procedure.
265 *
266 * The original procedure is modified during scheduling.
267 *
268 * @param procedure The procedure to schedule.
269 * @param targetMachine The target machine.
270 * @todo remove the targetMachine argument. The machine is given in the
271 * constructor and assumed to be the same for whole lifetime of the
272 * scheduler instance.
273 * @exception Exception In case of an error during scheduling. The exception
274 * type can be any subtype of Exception.
275 */
276void
278 TTAProgram::Procedure& procedure,
279 const TTAMachine::Machine& targetMachine) {
281
282 if (Application::verboseLevel() > 0) {
283 totalBasicBlocks_ = cfg.nodeCount() - 3;
285 << " -- " << totalBasicBlocks_ << " basic blocks" << std::endl;
287 }
288
289#ifdef CFG_SNAPSHOTS
290 cfg.writeToDotFile(procedure.name() + "_cfg.dot");
291#endif
292
295 int lowMemThreshold = DEFAULT_LOWMEM_MODE_THRESHOLD;
296
297 if (opts != NULL && opts->lowMemModeThreshold() > -1) {
298 lowMemThreshold = opts->lowMemModeThreshold();
299 }
300
301 if (procedure.instructionCount() < lowMemThreshold) {
302 // create the procedure-wide ddg.
305
306 if (options_ != NULL && options_->dumpDDGsDot()) {
308 (boost::format("proc_%s_before_scheduling.dot") %
309 bigDDG_->name()).str());
310 }
311
312 if (options_ != NULL && options_->dumpDDGsXML()) {
314 (boost::format("proc_%s_before_scheduling.xml") %
315 bigDDG_->name()).str());
316 }
317 }
318
319 if (delaySlotFiller_ != NULL && bigDDG_ != NULL) {
320 delaySlotFiller_->initialize(cfg, *bigDDG_, targetMachine);
321 }
322
323#ifdef BIG_DDG_SNAPSHOTS
324 bigDDG_->writeToDotFile(bigDDG_->name() + "_unscheduled_ddg.dot");
325#endif
326 scheduledProcedure_ = &procedure;
327
328 // dsf also called between scheduling.. have to update these before it.
329 // delay slot filler needs refs to be into instrs in cfg, not in
330 // original program
332
333 procedure.clear();
334
335 handleControlFlowGraph(cfg, targetMachine);
336
337 if (delaySlotFiller_ != NULL && bigDDG_ != NULL) {
338 delaySlotFiller_->fillDelaySlots(cfg, *bigDDG_, targetMachine);
339 }
340
341#ifdef CFG_SNAPSHOTS
342 cfg.writeToDotFile(procedure.name() + "_cfg_after.dot");
343#endif
344
345 // now all basic blocks are scheduled, let's put them back to the
346 // original procedure
347 cfg.copyToProcedure(procedure);
348 if (bigDDG_ != NULL) {
349
350 if (options_ != NULL && options_->dumpDDGsDot()) {
352 (boost::format("proc_%s_after_scheduling.dot") % bigDDG_->name())
353 .str());
354 }
355
356 if (options_ != NULL && options_->dumpDDGsXML()) {
358 (boost::format("proc_%s_after_scheduling.xml") % bigDDG_->name())
359 .str());
360 }
361 delete bigDDG_;
362 bigDDG_ = NULL;
363 }
364 if (delaySlotFiller_ != NULL) {
366 }
367 scheduledProcedure_ = NULL;
368}
369
370/**
371 * Schedules all nodes in a control flow graph.
372 *
373 * The original control flow graph nodes are modified during scheduling.
374 *
375 * @param cfg The control flow graph to schedule.
376 * @param targetMachine The target machine.
377 * @exception Exception In case of an error during scheduling. The exception
378 * type can be any subtype of Exception.
379 */
380void
382 ControlFlowGraph& cfg, const TTAMachine::Machine& targetMachine) {
383 return handleCFGDDG(cfg, bigDDG_, targetMachine);
384}
385
386/**
387 * Schedules a program.
388 *
389 * The original program is modified during scheduling.
390 *
391 * @param program The program to schedule.
392 * @param targetMachine The target machine.
393 * @exception Exception In case of an error during scheduling. The exception
394 * type can be any subtype of Exception.
395 */
396void
401
402/**
403 * A short description of the pass, usually the optimization name,
404 * such as "basic block scheduler".
405 *
406 * @return The description as a string.
407 */
408std::string
410 return "Instruction scheduler with a basic block scope.";
411}
412
413/**
414 * Optional longer description of the pass.
415 *
416 * This description can include usage instructions, details of choice of
417 * algorithmic details, etc.
418 *
419 * @return The description as a string.
420 */
421std::string
423 return
424 "Basic block scheduler that uses the longest path information of "
425 "data dependency graph to prioritize the ready list. Assumes that "
426 "the input has registers allocated and no connectivity missing.";
427}
428
429
430/**
431 * Helper function used to create DDG for BBPass.
432 *
433 * Overrided version in order to use subgraphs.
434 *
435 * @param bb BasicBlock where DDG is to be created from
436 */
440 if (bigDDG_ != NULL) {
441 return bigDDG_->createSubgraph(bb);
442 } else {
443 return this->ddgBuilder().build(
445 scheduledProcedure_->name() + '_' +
447 }
448}
449
450/**
451 * Creates a DDG from the given basic block and executes the set of DDG passes
452 * for that.
453 */
454void
456 TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
458 std::vector<DDGPass*> ddgPasses, BasicBlockNode* bbn) {
459 int minCycle = 0;
460 DataDependenceGraph* ddg = NULL;
461 SimpleResourceManager* rm = NULL;
462 // Used for live info dumping.
463 static int bbNumber = 0;
464 int min = INT_MAX;
465 int fastest = 0;
466 if (ddgPasses.size() > 1) {
467 for (unsigned int i = 0; i < ddgPasses.size(); i++) {
468 ddg = createDDGFromBB(bb, targetMachine);
469 rm = SimpleResourceManager::createRM(targetMachine);
470 rm->setDDG(ddg);
471 rm->setCFG(cfg_);
472 rm->setBBN(bbn);
473
474 int size =
475 ddgPasses[i]->handleDDG(*ddg, *rm, targetMachine, minCycle, true);
476 if (size < min) {
477 min = size;
478 fastest = i;
479 }
481 delete ddg;
482 ddg = NULL;
483 }
484 }
485 ddg = createDDGFromBB(bb, targetMachine);
486 rm = SimpleResourceManager::createRM(targetMachine);
487 rm->setDDG(static_cast<DataDependenceGraph*>(ddg->rootGraph()));
488 rm->setCFG(cfg_);
489 rm->setBBN(bbn);
490
491 if (options_ != NULL && options_->printResourceConstraints()) {
492 TCEString ddgName = ddg->name();
493 // Use the BBN id if possible so it's easier to find the matching BBs when
494 // looking at the if-conversion CFGs.
495 if (bbn != NULL)
496 ddgName << bbn->nodeID();
497 else
498 ddgName << bbNumber;
499 ResourceConstraintAnalyzer rcAnalyzer(*ddg, *rm, ddgName);
500 rcAnalyzer.analyzePreSchedule();
501 }
502
503
504#ifdef DDG_SNAPSHOTS
505 std::string name = "scheduling";
506 ddgSnapshot(ddg, name, false);
507#endif
508
509 try {
510 ddgPasses[fastest]->handleDDG(*ddg, *rm, targetMachine, minCycle);
511 if (bbn->isHWLoop()) {
513 ddg->largestCycle() + 1 - ddg->smallestCycle());
514 }
515 } catch (const Exception &e) {
517 abortWithError("Scheduling failed!");
518 }
519
520#ifdef DDG_SNAPSHOTS
521 std::string name = "scheduling";
522 ddgSnapshot(ddg, name, true);
523#endif
524
525 copyRMToBB(*rm, bb, targetMachine, irm);
526
527 bbNumber++;
528
529 if (options_ != NULL && options_->printResourceConstraints()) {
530 TCEString ddgName = ddg->name();
531 // Use the BBN id if possible so it's easier to find the matching BBs when
532 // looking at the if-conversion CFGs.
533 if (bbn != NULL)
534 ddgName << bbn->nodeID();
535 else
536 ddgName << bbNumber;
537 ResourceConstraintAnalyzer rcAnalyzer(*ddg, *rm, ddgName);
538 rcAnalyzer.analyze();
539 }
540
541 if (delaySlotFiller_ != NULL && bigDDG_ != NULL) {
542 rm->clearOldResources();
544 } else {
546 }
547
548 // print some stats about the loop kernel body DDGs
549 if (Application::verboseLevel() > 1 && bb.isInInnerLoop()) {
551 << "DDG height " << ddg->height() << std::endl;
552 }
553
554 delete ddg;
555}
556
557/* Returns true if node count changed */
560 const TTAMachine::Machine& targetMachine, int nodeCount) {
561
562 TCEString procName = cfg.procedureName();
563 if (procName == "") procName = cfg.name();
564
565 if (!bb.isNormalBB() || bb.isScheduled()) {
566 return false;
567 }
568
570 bb.basicBlock(), targetMachine,
571 cfg.instructionReferenceManager(), &bb);
572 bb.setScheduled();
573
574 if (delaySlotFiller_ != NULL && bigDDG_ != NULL) {
576 }
577
578 // if some node is removed, make sure does not skip some node and
579 // then try to handle too many nodes.
580 if (cfg.nodeCount() != nodeCount) {
581 return true;
582 }
583 return false;
584}
585void
587 ControlFlowGraph& cfg,
589 const TTAMachine::Machine& targetMachine) {
590 cfg_ = &cfg;
591 bigDDG_ = ddg;
592
594 est.handleControlFlowGraph(cfg, targetMachine);
595
596 int nodeCount = cfg.nodeCount();
597
598 // for handle single-BB-loops
599 for (int bbIndex = 0; bbIndex < nodeCount; ++bbIndex) {
600 BasicBlockNode& bb = cfg.node(bbIndex);
601 if (!cfg.isSingleBBLoop(bb)) {
602 continue;
603 }
604
605 if (handleBBNode(cfg, bb, targetMachine, nodeCount)) {
606 nodeCount = cfg.nodeCount();
607 bbIndex = 0;
608 }
609 }
610
611 // then handle BBs which do not have outgoing jumps.
612 for (int bbIndex = 0; bbIndex < nodeCount; ++bbIndex) {
613 BasicBlockNode& bb = cfg.node(bbIndex);
614 auto jumpDest = cfg.jumpSuccessor(bb);
615 if (jumpDest != nullptr && jumpDest->isNormalBB()) {
616 continue;
617 }
618
619 if (handleBBNode(cfg, bb, targetMachine, nodeCount)) {
620 nodeCount = cfg.nodeCount();
621 bbIndex = 0;
622 }
623 }
624
625
626 for (int bbIndex = cfg.nodeCount() -1; bbIndex >= 0; --bbIndex) {
627 BasicBlockNode& bb = cfg.node(bbIndex);
628 auto jumpDest = cfg.jumpSuccessor(bb);
629 if (jumpDest == nullptr || !jumpDest->isNormalBB()) {
630 continue;
631 }
632
633 if (cfg.allScheduledInBetween(bb, *jumpDest)) {
634 if (handleBBNode(cfg, bb, targetMachine, nodeCount)) {
635 nodeCount = cfg.nodeCount();
636 bbIndex = nodeCount -1;
637 }
638 }
639 }
640
641 for (int bbIndex = cfg.nodeCount() -1; bbIndex >= 0; --bbIndex) {
642 BasicBlockNode& bb = cfg.node(bbIndex);
643 if (handleBBNode(cfg, bb, targetMachine, nodeCount)) {
644 nodeCount = cfg.nodeCount();
645 bbIndex = nodeCount -1;
646 }
647 }
648}
649
#define debugLog(text)
#define abortWithError(message)
static const int MAXIMUM_II
static const int DEFAULT_LOWMEM_MODE_THRESHOLD
find Finds info of the inner loops in the program
static MachInfoCmdLineOptions options
Definition MachInfo.cc:46
static CmdLineOptions * cmdLineOptions()
static int verboseLevel()
static std::ostream & logStream()
ControlFlowGraph * cfg_
Control flow graph of the procedure.
DataDependenceGraph * bigDDG_
whole-procedure DDG.
TTAProgram::Procedure * scheduledProcedure_
The currently scheduled procedure.
int basicBlocksScheduled_
Number of basic blocks scheduled so far.
LLVMTCECmdLineOptions * options_
SoftwareBypasser * softwareBypasser_
The software bypasser to use to bypass registers when possible.
bool handleBBNode(ControlFlowGraph &cfg, BasicBlockNode &bbn, const TTAMachine::Machine &targetMachine, int nodeCount)
BBSchedulerController(const TTAMachine::Machine &targetMachine, InterPassData &data, SoftwareBypasser *bypasser=NULL, CopyingDelaySlotFiller *delaySlotFiller=NULL, DataDependenceGraph *bigDDG=NULL)
virtual void handleBasicBlock(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL) override
virtual void handleProgram(TTAProgram::Program &program, const TTAMachine::Machine &targetMachine) override
CopyingDelaySlotFiller * delaySlotFiller_
virtual DataDependenceGraph * createDDGFromBB(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach)
virtual void executeDDGPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL) override
virtual std::string shortDescription() const override
virtual std::string longDescription() const override
int totalBasicBlocks_
Total basic blocks in the CFG currently being scheduled.
virtual void handleProcedure(TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetMachine) override
virtual void handleControlFlowGraph(ControlFlowGraph &cfg, const TTAMachine::Machine &targetMachine) override
virtual void handleCFGDDG(ControlFlowGraph &cfg, DataDependenceGraph *ddg, const TTAMachine::Machine &targetMachine)
void setScheduled(bool state=true)
TTAProgram::BasicBlock & basicBlock()
bool isNormalBB() const
bool isHWLoop() const
const BasicBlockNode * predecessor() const
std::string toString() const
bool isScheduled() const
void updateHWloopLength(unsigned len)
static void copyRMToBB(SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1)
virtual bool executeLoopPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL)
virtual DataDependenceGraphBuilder & ddgBuilder()
void ddgSnapshot(DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final)
BoostGraph * rootGraph()
int nodeCount() const
Node & node(const int index) const
virtual const TCEString & name() const
int height() const
TTAProgram::InstructionReferenceManager & instructionReferenceManager()
void copyToProcedure(TTAProgram::Procedure &proc, TTAProgram::InstructionReferenceManager *irm=NULL)
BasicBlockNode * jumpSuccessor(BasicBlockNode &bbn)
bool allScheduledInBetween(const BasicBlockNode &src, const BasicBlockNode &dst) const
TCEString procedureName() const
bool isSingleBBLoop(const BasicBlockNode &node) const
static std::string toString(const T &source)
void initialize(ControlFlowGraph &cfg, DataDependenceGraph &ddg, const TTAMachine::Machine &machine)
void fillDelaySlots(ControlFlowGraph &cfg, DataDependenceGraph &ddg, const TTAMachine::Machine &machine)
void addResourceManager(TTAProgram::BasicBlock &bbn, SimpleResourceManager &rm)
void bbnScheduled(BasicBlockNode &bbn)
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)
DataDependenceGraph * createSubgraph(NodeSet &nodes, bool includeLoops=false)
void writeToXMLFile(std::string fileName) const
std::string errorMessageStack(bool messagesOnly=false) const
Definition Exception.cc:138
virtual void writeToDotFile(const TCEString &fileName) const
int nodeID() const
bool hasDatum(const std::string &key) const
virtual bool dumpDDGsDot() const
virtual bool dumpDDGsXML() const
static LoopAnalysisResult * analyze(BasicBlockNode &bbn, DataDependenceGraph &ddg)
static std::set< const TTAMachine::RegisterFile *, TTAMachine::MachinePart::Comparator > tempRegisterFiles(const TTAMachine::Machine &machine)
std::string toString() const
Definition MoveNode.cc:576
static void executeProcedurePass(TTAProgram::Program &program, const TTAMachine::Machine &targetMachine, ProcedurePass &procedurePass)
virtual void handleControlFlowGraph(ControlFlowGraph &cfg, const TTAMachine::Machine &mach) override
virtual int lowMemModeThreshold() const
virtual bool isLoopOptDefined() const
InterPassData & interPassData()
void setBBN(const BasicBlockNode *bbn)
static void disposeRM(SimpleResourceManager *rm, bool allowReuse=true)
void setCFG(const ControlFlowGraph *cfg)
static SimpleResourceManager * createRM(const TTAMachine::Machine &machine, unsigned int ii=0)
void setDDG(const DataDependenceGraph *ddg)
LiveRangeData * liveRangeData_
bool isInInnerLoop() const
returns true in case the BB is known to be inside an inner loop
void setTripCount(unsigned count)
unsigned tripCount() const
in case the BB is inside a loop and trip count is known, returns it, otherwise returns 0
virtual int instructionCount() const
virtual Instruction & lastInstruction() const
TCEString name() const
Definition Procedure.hh:66
MoveNodeUseMapSet regFirstUses_
MoveNodeUseMapSet regLastUses_
std::set< TCEString > registersUsedAfter_
MoveNodeUseMapSet regFirstDefines_
MoveNodeUseMapSet regDefines_
MoveNodeUseMapSet regDefReaches_