OpenASIP 2.2
Loading...
Searching...
No Matches
BBSchedulerController.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2015 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.hh
26 *
27 * Declaration of BBSchedulerController class.
28 * @author Pekka Jääskeläinen 2006-2011 (pjaaskel-no.spam-cs.tut.fi)
29 * @author Heikki Kultala 2009 (hkultala-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_BB_SCHEDULER_CONTROLLER_HH
34#define TTA_BB_SCHEDULER_CONTROLLER_HH
35
36#include "BasicBlockPass.hh"
38#include "ProcedurePass.hh"
39#include "ProgramPass.hh"
40#include "Program.hh"
41
42class BasicBlockNode;
46class DDGPass;
48
49namespace TTAProgram {
50 class Procedure;
51 class Program;
52}
53
54/**
55 * A class that control operation of a basic block scheduler.
56 *
57 * This class handles calling other optimization passes and tranferring data
58 * for the actual BB scheduler and loop scheudlers etc.
59 */
62 public ProgramPass {
63public:
65 const TTAMachine::Machine& targetMachine,
66 InterPassData& data, SoftwareBypasser* bypasser=NULL,
67 CopyingDelaySlotFiller* delaySlotFiller=NULL,
68 DataDependenceGraph* bigDDG = NULL);
69 virtual ~BBSchedulerController();
70
71 virtual void handleBasicBlock(
72 TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
74 BasicBlockNode* bbn = NULL) override;
75
76 virtual void handleControlFlowGraph(
78 const TTAMachine::Machine& targetMachine) override;
79
80 virtual void handleProcedure(
81 TTAProgram::Procedure& procedure,
82 const TTAMachine::Machine& targetMachine) override;
83
84 // is needed only for some sw bypass statistics
85 virtual void handleProgram(
87 const TTAMachine::Machine& targetMachine) override;
88
89 bool handleBBNode(
91 const TTAMachine::Machine& targetMachine, int nodeCount);
92
93 virtual void executeDDGPass(
94 TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
96 std::vector<DDGPass*> ddgPasses, BasicBlockNode* bbn = NULL) override;
97
98 virtual void handleCFGDDG(
101 const TTAMachine::Machine& targetMachine);
102
103 virtual std::string shortDescription() const override;
104 virtual std::string longDescription() const override;
105
106protected:
109
110private:
111
113
114 /// The currently scheduled procedure.
116
117 /// Control flow graph of the procedure.
119
120 /// whole-procedure DDG.
122 /// The software bypasser to use to bypass registers when possible.
124
126
127 /// Number of basic blocks scheduled so far.
129 /// Total basic blocks in the CFG currently being scheduled.
131
133};
134
135#endif
find Finds info of the inner loops in the program
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)
virtual void handleBasicBlock(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL) override
const TTAMachine::Machine & targetMachine_
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)