OpenASIP  2.0
LoopPrologAndEpilogBuilder.hh
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 LoopPrologAndEpilogBuilder.hh
26  *
27  * Declaration of LoopPrologAndEpilogBuilder interface.
28  *
29  * @author Mikael Lepistö 2008 (mikael.lepisto-no.spam-tut.fi)
30  * @author Heikki Kultala 2015-2020 (heikki.kultala-no.spam-tuni.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_LOOP_PROLOG_AND_EPILOG_BUILDER_HH
35 #define TTA_LOOP_PROLOG_AND_EPILOG_BUILDER_HH
36 
39 class BasicBlockNode;
40 class ControlFlowGraph;
41 class ControlFlowEdge;
42 
43 namespace TTAProgram {
44  class Move;
45  class BasicBlock;
46  class InstructionReferenceManager;
47  class Immediate;
48 }
49 
50 /**
51  * Classes that implement this interface are able to software bypass
52  * moves.
53  */
55 public:
58  virtual int build(DataDependenceGraph& ddg, SimpleResourceManager& rm,
59  ControlFlowGraph& cfg, BasicBlockNode& loopBBN,
60  int endCycle = -1, bool createEpilog = true);
61 
63  SimpleResourceManager& prologRM,
64  SimpleResourceManager& loopRM,
65  ControlFlowGraph& cfg, BasicBlockNode& loopBBN);
66 
68  SimpleResourceManager& prologEpilogRM,
69  int ii, ControlFlowGraph& cfg, BasicBlockNode& loopBBN);
70 
71 private:
72 
75  BasicBlockNode& tail,
76  BasicBlockNode& dst, ControlFlowEdge& jumpEdge);
77 
78  void addPrologIntoCfg(
79  ControlFlowGraph& cfg, BasicBlockNode& prologBBN,
80  BasicBlockNode& loopBBN);
81 
82  void addEpilogIntoCfg(
83  ControlFlowGraph& cfg, BasicBlockNode& epilogBBN,
84  BasicBlockNode& loopBBN);
85 
88 };
89 
90 #endif
TTAProgram
Definition: Estimator.hh:65
LoopPrologAndEpilogBuilder::build
virtual int build(DataDependenceGraph &ddg, SimpleResourceManager &rm, ControlFlowGraph &cfg, BasicBlockNode &loopBBN, int endCycle=-1, bool createEpilog=true)
Definition: LoopPrologAndEpilogBuilder.cc:192
LoopPrologAndEpilogBuilder::~LoopPrologAndEpilogBuilder
virtual ~LoopPrologAndEpilogBuilder()
Definition: LoopPrologAndEpilogBuilder.cc:59
LoopPrologAndEpilogBuilder::addPrologFromRM
BasicBlockNode * addPrologFromRM(SimpleResourceManager &prologRM, SimpleResourceManager &loopRM, ControlFlowGraph &cfg, BasicBlockNode &loopBBN)
Definition: LoopPrologAndEpilogBuilder.cc:408
LoopPrologAndEpilogBuilder::moveJumpDestination
void moveJumpDestination(TTAProgram::InstructionReferenceManager &irm, BasicBlockNode &tail, BasicBlockNode &dst, ControlFlowEdge &jumpEdge)
Definition: LoopPrologAndEpilogBuilder.cc:63
ControlFlowEdge
Definition: ControlFlowEdge.hh:50
LoopPrologAndEpilogBuilder::optimizeEpilog
bool optimizeEpilog(TTAProgram::BasicBlock &epilog)
Definition: LoopPrologAndEpilogBuilder.cc:575
LoopPrologAndEpilogBuilder::addPrologIntoCfg
void addPrologIntoCfg(ControlFlowGraph &cfg, BasicBlockNode &prologBBN, BasicBlockNode &loopBBN)
Definition: LoopPrologAndEpilogBuilder.cc:120
LoopPrologAndEpilogBuilder::addEpilogFromRM
BasicBlockNode * addEpilogFromRM(SimpleResourceManager &prologEpilogRM, int ii, ControlFlowGraph &cfg, BasicBlockNode &loopBBN)
Definition: LoopPrologAndEpilogBuilder.cc:448
LoopPrologAndEpilogBuilder::optimizeProlog
bool optimizeProlog(TTAProgram::BasicBlock &prolog)
Definition: LoopPrologAndEpilogBuilder.cc:492
BasicBlockNode
Definition: BasicBlockNode.hh:64
LoopPrologAndEpilogBuilder::addEpilogIntoCfg
void addEpilogIntoCfg(ControlFlowGraph &cfg, BasicBlockNode &epilogBBN, BasicBlockNode &loopBBN)
Definition: LoopPrologAndEpilogBuilder.cc:166
LoopPrologAndEpilogBuilder::LoopPrologAndEpilogBuilder
LoopPrologAndEpilogBuilder()
Definition: LoopPrologAndEpilogBuilder.cc:56
TTAProgram::BasicBlock
Definition: BasicBlock.hh:85
TTAProgram::InstructionReferenceManager
Definition: InstructionReferenceManager.hh:82
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
SimpleResourceManager
Definition: SimpleResourceManager.hh:58
LoopPrologAndEpilogBuilder
Definition: LoopPrologAndEpilogBuilder.hh:54
ControlFlowGraph
Definition: ControlFlowGraph.hh:100