OpenASIP  2.0
MoveNodeDuplicator.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 /**
26  * This class is used for copying moves from a basic block to another
27  * corresponding basic block, copying also the programoperation structure.
28  */
29 
30 #ifndef MOVENODE_DUPLICATOR_HH
31 #define MOVENODE_DUPLICATOR_HH
32 #include "MoveNode.hh"
33 #include "ProgramOperation.hh"
34 
35 class BasicBlockNode;
37 
39 public:
41  DataDependenceGraph& oldDDG, DataDependenceGraph& newDDG);
42 
43  std::pair<MoveNode*, bool> duplicateMoveNode(
44  MoveNode& mn, bool addToDDG, bool ignoreSameBBBackEdges);
45  std::shared_ptr<TTAProgram::Move> duplicateMove(TTAProgram::Move& old);
46 
49 
50  void disposeMoveNode(MoveNode *newMN);
51 
52  void setBBN(BasicBlockNode& bbn) {
53  bbn_ = &bbn;
54  }
55 
58  void dumpDDG();
59 
60 private:
61  // old to copied mapping
62  std::map<ProgramOperation*,
66  // copied to old mapping
67  std::map<ProgramOperation*,
71  // old to copied mapping
72  std::map<MoveNode*,MoveNode*,MoveNode::Comparator> moveNodes_;
73  // copied to old mapping
74  std::map<MoveNode*,MoveNode*,MoveNode::Comparator> oldMoveNodes_;
75  std::map<TTAProgram::Move*,std::shared_ptr<TTAProgram::Move> > moves_;
76 
81 
82 };
83 
84 #endif
MoveNodeDuplicator::newDDG_
DataDependenceGraph * newDDG_
Definition: MoveNodeDuplicator.hh:79
MoveNodeDuplicator::setBBN
void setBBN(BasicBlockNode &bbn)
Definition: MoveNodeDuplicator.hh:52
MoveNodeDuplicator::bigDDG_
DataDependenceGraph * bigDDG_
Definition: MoveNodeDuplicator.hh:80
MoveNodeDuplicator::programOperations_
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > programOperations_
Definition: MoveNodeDuplicator.hh:65
MoveNodeDuplicator::dumpDDG
void dumpDDG()
Definition: MoveNodeDuplicator.cc:273
MoveNodeDuplicator::MoveNodeDuplicator
MoveNodeDuplicator(DataDependenceGraph &oldDDG, DataDependenceGraph &newDDG)
Definition: MoveNodeDuplicator.cc:48
MoveNodeDuplicator
Definition: MoveNodeDuplicator.hh:38
MoveNodeDuplicator::moves_
std::map< TTAProgram::Move *, std::shared_ptr< TTAProgram::Move > > moves_
Definition: MoveNodeDuplicator.hh:75
ProgramOperation
Definition: ProgramOperation.hh:70
MoveNode
Definition: MoveNode.hh:65
MoveNodeDuplicator::duplicateProgramOperationPtr
ProgramOperationPtr duplicateProgramOperationPtr(ProgramOperationPtr old)
Definition: MoveNodeDuplicator.cc:173
ProgramOperation::Comparator
Definition: ProgramOperation.hh:148
MoveNodeDuplicator::bbn_
BasicBlockNode * bbn_
Definition: MoveNodeDuplicator.hh:77
ProgramOperationPtr
std::shared_ptr< ProgramOperation > ProgramOperationPtr
Definition: MoveNode.hh:52
MoveNodeDuplicator::duplicateMoveNode
std::pair< MoveNode *, bool > duplicateMoveNode(MoveNode &mn, bool addToDDG, bool ignoreSameBBBackEdges)
Definition: MoveNodeDuplicator.cc:106
MoveNodeDuplicator::disposeMoveNode
void disposeMoveNode(MoveNode *newMN)
Definition: MoveNodeDuplicator.cc:53
MoveNodeDuplicator::oldDDG_
DataDependenceGraph * oldDDG_
Definition: MoveNodeDuplicator.hh:78
BasicBlockNode
Definition: BasicBlockNode.hh:64
TTAProgram::Move
Definition: Move.hh:55
MoveNodeDuplicator::getProgramOperation
ProgramOperationPtr getProgramOperation(ProgramOperationPtr old)
Definition: MoveNodeDuplicator.cc:188
ProgramOperation.hh
MoveNodeDuplicator::moveNodes_
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > moveNodes_
Definition: MoveNodeDuplicator.hh:72
MoveNodeDuplicator::getMoveNode
MoveNode * getMoveNode(MoveNode &mn)
Definition: MoveNodeDuplicator.cc:85
MoveNodeDuplicator::oldProgramOperations_
std::map< ProgramOperation *, ProgramOperationPtr, ProgramOperation::Comparator > oldProgramOperations_
Definition: MoveNodeDuplicator.hh:70
MoveNodeDuplicator::oldMoveNodes_
std::map< MoveNode *, MoveNode *, MoveNode::Comparator > oldMoveNodes_
Definition: MoveNodeDuplicator.hh:74
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
MoveNode.hh
MoveNodeDuplicator::duplicateMove
std::shared_ptr< TTAProgram::Move > duplicateMove(TTAProgram::Move &old)
Definition: MoveNodeDuplicator.cc:199