OpenASIP  2.0
BFRenameLiveRange.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2014 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  * @file BFRenameLiveRange.hh
27  *
28  * Declaration of BFRenameLiveRange class
29  *
30  * Renames a liverange, consisting of one or more writes,
31  * and one or more either register reads or guadrd uses of the register.
32  *
33  * @author Heikki Kultala 2014-2020(heikki.kultala-no.spam-tuni.fi)
34  * @note rating: red
35  */
36 
37 #ifndef BF_RENAME_LIVERANGE_HH
38 #define BF_RENAME_LIVERANGE_HH
39 
40 #include "BFOptimization.hh"
41 #include "LiveRangeData.hh"
42 #include "DataDependenceGraph.hh"
43 #include "Terminal.hh"
44 
46 
47 public:
49  std::shared_ptr<LiveRange> liveRange,
50  int targetCycle);
51 
52  virtual bool operator()();
53  virtual ~BFRenameLiveRange();
54 
55 protected:
56  void undoSetTerminal();
57  void setTerminals();
58 
59  void setGuard(TTAProgram::Move& move,
60  const TTAMachine::RegisterFile& rf, int regIndex);
61  void setRegDefsAndLastUses();
63  void setFirstDefsAndUses();
65  void setOutgoingDeps();
66  void setIncomingDeps();
67  void unsetIncomingDeps();
68  void unsetOutgoingDeps();
69  void undoNewAntiDeps();
70  void notifySelector();
71 
72  bool renameLiveRange(
73  class LiveRange& liveRange,
74  const class TCEString& reg,
75  bool usedAfter);
76 
77  virtual void undoOnlyMe() override;
78 
80  std::map<const MoveNode*,
84 
86  std::shared_ptr<LiveRange> liveRange_;
89 
93 
98 
99 
100 };
101 
102 #endif
BFRenameLiveRange::setOutgoingDeps
void setOutgoingDeps()
Definition: BFRenameLiveRange.cc:207
BFRenameLiveRange::setIncomingDeps
void setIncomingDeps()
Definition: BFRenameLiveRange.cc:186
BFRenameLiveRange::operator()
virtual bool operator()()
Definition: BFRenameLiveRange.cc:60
BFRenameLiveRange::undoSetRegDefsAndLastUses
void undoSetRegDefsAndLastUses()
Definition: BFRenameLiveRange.cc:243
BFRenameLiveRange::liveRange_
std::shared_ptr< LiveRange > liveRange_
Definition: BFRenameLiveRange.hh:86
BFRenameLiveRange::newReg_
TCEString newReg_
Definition: BFRenameLiveRange.hh:88
BFRenameLiveRange::undoSetFirstDefsAndUses
void undoSetFirstDefsAndUses()
Definition: BFRenameLiveRange.cc:289
LiveRangeData::MoveNodeUseSet
std::set< MoveNodeUse > MoveNodeUseSet
Definition: LiveRangeData.hh:51
MoveNodeUse
Definition: MoveNodeUse.hh:20
BFRenameLiveRange::oldRegFirstDefines_
LiveRangeData::MoveNodeUseSet oldRegFirstDefines_
Definition: BFRenameLiveRange.hh:95
BFRenameLiveRange::setTerminals
void setTerminals()
Definition: BFRenameLiveRange.cc:89
DataDependenceGraph.hh
MoveNode
Definition: MoveNode.hh:65
BFOptimization
Definition: BFOptimization.hh:73
Terminal.hh
BFRenameLiveRange::unsetIncomingDeps
void unsetIncomingDeps()
Definition: BFRenameLiveRange.cc:196
BFRenameLiveRange::createdAntidepEdges_
DataDependenceGraph::EdgeSet createdAntidepEdges_
Definition: BFRenameLiveRange.hh:97
BFRenameLiveRange::undoReadUpdateData_
std::map< const MoveNode *, DataDependenceGraph::UndoData, MoveNode::Comparator > undoReadUpdateData_
Definition: BFRenameLiveRange.hh:83
BFRenameLiveRange::oldRegFirstUses_
LiveRangeData::MoveNodeUseSet oldRegFirstUses_
Definition: BFRenameLiveRange.hh:96
BFRenameLiveRange::undoSetTerminal
void undoSetTerminal()
Definition: BFRenameLiveRange.cc:136
BFRenameLiveRange::BFRenameLiveRange
BFRenameLiveRange(BF2Scheduler &sched, std::shared_ptr< LiveRange > liveRange, int targetCycle)
Definition: BFRenameLiveRange.cc:52
BFRenameLiveRange::undoWriteUpdateData_
DataDependenceGraph::UndoData undoWriteUpdateData_
Definition: BFRenameLiveRange.hh:79
BoostGraph< MoveNode, DataDependenceEdge >::EdgeSet
std::set< DataDependenceEdge *, typename DataDependenceEdge ::Comparator > EdgeSet
Definition: BoostGraph.hh:87
BFRenameLiveRange::unsetOutgoingDeps
void unsetOutgoingDeps()
Definition: BFRenameLiveRange.cc:202
BFRenameLiveRange::setRegDefsAndLastUses
void setRegDefsAndLastUses()
Definition: BFRenameLiveRange.cc:222
BFRenameLiveRange::notifySelector
void notifySelector()
Definition: BFRenameLiveRange.cc:419
BFRenameLiveRange::oldReg_
class TTAProgram::Terminal * oldReg_
Definition: BFRenameLiveRange.hh:85
BFRenameLiveRange::oldLastKill_
MoveNodeUse oldLastKill_
Definition: BFRenameLiveRange.hh:90
BFRenameLiveRange::undoOnlyMe
virtual void undoOnlyMe() override
Definition: BFRenameLiveRange.cc:158
BF2Scheduler
Definition: BF2Scheduler.hh:74
GraphNode::Comparator
Definition: GraphNode.hh:56
TTAProgram::Move
Definition: Move.hh:55
BFRenameLiveRange::setFirstDefsAndUses
void setFirstDefsAndUses()
Definition: BFRenameLiveRange.cc:263
BFRenameLiveRange
Definition: BFRenameLiveRange.hh:45
BFRenameLiveRange::undoNewAntiDeps
void undoNewAntiDeps()
Definition: BFRenameLiveRange.cc:179
TTAProgram::BasicBlock
Definition: BasicBlock.hh:85
DataDependenceGraph::UndoData
Definition: DataDependenceGraph.hh:71
BFRenameLiveRange::bb_
TTAProgram::BasicBlock * bb_
Definition: BFRenameLiveRange.hh:87
BFRenameLiveRange::~BFRenameLiveRange
virtual ~BFRenameLiveRange()
Definition: BFRenameLiveRange.cc:478
LiveRangeData.hh
TCEString
Definition: TCEString.hh:53
BFRenameLiveRange::oldRegDefines_
LiveRangeData::MoveNodeUseSet oldRegDefines_
Definition: BFRenameLiveRange.hh:94
TTAProgram::Terminal
Definition: Terminal.hh:60
BFRenameLiveRange::setGuard
void setGuard(TTAProgram::Move &move, const TTAMachine::RegisterFile &rf, int regIndex)
Definition: BFRenameLiveRange.cc:117
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
LiveRange
Definition: LiveRange.hh:38
BFRenameLiveRange::oldKill_
MoveNodeUse oldKill_
Definition: BFRenameLiveRange.hh:91
BFRenameLiveRange::targetCycle_
int targetCycle_
Definition: BFRenameLiveRange.hh:92
BFRenameLiveRange::renameLiveRange
bool renameLiveRange(class LiveRange &liveRange, const class TCEString &reg, bool usedAfter)
Definition: BFRenameLiveRange.cc:319
BFOptimization.hh