OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BFRenameLiveRange Class Reference

#include <BFRenameLiveRange.hh>

Inheritance diagram for BFRenameLiveRange:
Inheritance graph
Collaboration diagram for BFRenameLiveRange:
Collaboration graph

Public Member Functions

 BFRenameLiveRange (BF2Scheduler &sched, std::shared_ptr< LiveRange > liveRange, int targetCycle)
 
virtual bool operator() ()
 
virtual ~BFRenameLiveRange ()
 
- Public Member Functions inherited from BFOptimization
 BFOptimization (BF2Scheduler &sched)
 
virtual bool isFinishFront ()
 
virtual void mightBeReady (MoveNode &mn)
 
- Public Member Functions inherited from Reversible
virtual void undo ()
 
virtual ~Reversible ()
 
void deleteChildren (std::stack< Reversible * > &children)
 
int id ()
 
 Reversible ()
 

Protected Member Functions

void undoSetTerminal ()
 
void setTerminals ()
 
void setGuard (TTAProgram::Move &move, const TTAMachine::RegisterFile &rf, int regIndex)
 
void setRegDefsAndLastUses ()
 
void undoSetRegDefsAndLastUses ()
 
void setFirstDefsAndUses ()
 
void undoSetFirstDefsAndUses ()
 
void setOutgoingDeps ()
 
void setIncomingDeps ()
 
void unsetIncomingDeps ()
 
void unsetOutgoingDeps ()
 
void undoNewAntiDeps ()
 
void notifySelector ()
 
bool renameLiveRange (class LiveRange &liveRange, const class TCEString &reg, bool usedAfter)
 
virtual void undoOnlyMe () override
 
- Protected Member Functions inherited from BFOptimization
DataDependenceGraphddg ()
 
DataDependenceGraphrootDDG ()
 
const DataDependenceGraphddg () const
 
DataDependenceGraphprologDDG ()
 
SimpleResourceManagerrm () const
 
SimpleResourceManagerprologRM () const
 
BUMoveNodeSelectorselector ()
 
const TTAMachine::MachinetargetMachine () const
 
unsigned int ii () const
 
MoveNodeDuplicatorduplicator () const
 
virtual bool assign (int cycle, MoveNode &, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU_=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGuardWriteCycle=false)
 
virtual void unassign (MoveNode &mn, bool disposePrologCopy=true)
 
virtual int rmEC (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1)
 
virtual int rmLC (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1)
 
virtual bool canAssign (int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGWN=false)
 
bool putAlsoToPrologEpilog (int cycle, MoveNode &mn)
 
void setPrologSrcFUAnno (MoveNode &prologMN, MoveNode &loopMN)
 
void setPrologDstFUAnno (MoveNode &prologMN, MoveNode &loopMN)
 
void setJumpGuard (MoveNode &mn)
 
void unsetJumpGuard (MoveNode &mn)
 
bool needJumpGuard (const MoveNode &mn, int cycle)
 
int jumpGuardAvailableCycle (const MoveNode &mn)
 
bool canBeSpeculated (const Operation &op)
 
bool canBeSpeculated (const MoveNode &mn)
 
bool usePrologMove (const MoveNode &mn)
 
bool canBeScheduled (const MoveNode &mn)
 
const TTAMachine::RegisterFileRFReadPortCountPreventsScheduling (const MoveNode &mn)
 
bool immCountPreventsScheduling (const MoveNode &mn)
 
- Protected Member Functions inherited from Reversible
bool runPreChild (Reversible *preChild)
 
bool runPostChild (Reversible *preChild)
 
bool runChild (std::stack< Reversible * > &children, Reversible *child)
 
bool runChild (Reversible *child, bool pre)
 
void undoAndRemovePreChildren ()
 
void undoAndRemovePostChildren ()
 
void undoAndRemoveChildren (std::stack< Reversible * > &children)
 

Protected Attributes

DataDependenceGraph::UndoData undoWriteUpdateData_
 
std::map< const MoveNode *, DataDependenceGraph::UndoData, MoveNode::ComparatorundoReadUpdateData_
 
class TTAProgram::TerminaloldReg_
 
std::shared_ptr< LiveRangeliveRange_
 
TTAProgram::BasicBlockbb_
 
TCEString newReg_
 
MoveNodeUse oldLastKill_
 
MoveNodeUse oldKill_
 
int targetCycle_
 
LiveRangeData::MoveNodeUseSet oldRegDefines_
 
LiveRangeData::MoveNodeUseSet oldRegFirstDefines_
 
LiveRangeData::MoveNodeUseSet oldRegFirstUses_
 
DataDependenceGraph::EdgeSet createdAntidepEdges_
 
- Protected Attributes inherited from BFOptimization
BF2Schedulersched_
 
- Protected Attributes inherited from Reversible
std::stack< Reversible * > preChildren_
 
std::stack< Reversible * > postChildren_
 

Additional Inherited Members

- Static Public Member Functions inherited from BFOptimization
static void clearPrologMoves ()
 
static MoveNodegetSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach)
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 45 of file BFRenameLiveRange.hh.

Constructor & Destructor Documentation

◆ BFRenameLiveRange()

BFRenameLiveRange::BFRenameLiveRange ( BF2Scheduler sched,
std::shared_ptr< LiveRange liveRange,
int  targetCycle 
)

Definition at line 52 of file BFRenameLiveRange.cc.

55 :
56 BFOptimization(sched), oldReg_(nullptr), liveRange_(liveRange),
57 targetCycle_(targetCycle) {}
class TTAProgram::Terminal * oldReg_
std::shared_ptr< LiveRange > liveRange_

◆ ~BFRenameLiveRange()

BFRenameLiveRange::~BFRenameLiveRange ( )
virtual

Definition at line 478 of file BFRenameLiveRange.cc.

478 {
479 delete oldReg_;
480}

References oldReg_.

Member Function Documentation

◆ notifySelector()

void BFRenameLiveRange::notifySelector ( )
protected

Definition at line 419 of file BFRenameLiveRange.cc.

419 {
420 // then update ddg and notify selector.
421
422 // for writes.
423 for (auto i: liveRange_->writes) {
424 DataDependenceGraph::NodeSet writeSuccessors =
425 ddg().successors(*i);
426 DataDependenceGraph::NodeSet writePredecessors =
427 ddg().predecessors(*i);
428
429 // notify successors of write to prevent orphan nodes.
430 for (auto j: writeSuccessors) {
432 }
433
434 // notify successors of write to prevent orphan nodes.
435 for (auto j: writePredecessors) {
437 }
438
439 }
440
441 // for reads
442 for (auto i: liveRange_->reads) {
444 ddg().successors(*i);
445 DataDependenceGraph::NodeSet predecessors =
446 ddg().predecessors(*i);
447
448 // notify successors to prevent orphan nodes.
449 for (auto j: successors) {
451 }
452
453 // notify successors to prevent orphan nodes.
454 for (auto j: predecessors) {
456 }
457 }
458
459 // for guards
460 for (auto i: liveRange_->guards) {
462 ddg().successors(*i);
463 DataDependenceGraph::NodeSet predecessors =
464 ddg().predecessors(*i);
465
466 // notify successors to prevent orphan nodes.
467 for (auto j: successors) {
469 }
470
471 // notify successors to prevent orphan nodes.
472 for (auto j: predecessors) {
474 }
475 }
476}
void mightBeReady(MoveNode &n) override
BF2ScheduleFront * currentFront()
BF2Scheduler & sched_
DataDependenceGraph & ddg()
virtual NodeSet successors(const Node &node, bool ignoreBackEdges=false, bool ignoreForwardEdges=false) const
virtual NodeSet predecessors(const Node &node, bool ignoreBackEdges=false, bool ignoreForwardEdges=false) const
std::set< GraphNode *, typename GraphNode::Comparator > NodeSet
Definition Graph.hh:53

References BF2Scheduler::currentFront(), BFOptimization::ddg(), liveRange_, BF2ScheduleFront::mightBeReady(), BoostGraph< GraphNode, GraphEdge >::predecessors(), BFOptimization::sched_, and BoostGraph< GraphNode, GraphEdge >::successors().

Referenced by renameLiveRange().

Here is the call graph for this function:

◆ operator()()

bool BFRenameLiveRange::operator() ( )
virtual

This performs the operation. Returns true if success, false if fail.

Implements Reversible.

Definition at line 60 of file BFRenameLiveRange.cc.

60 {
61
62 bb_ = &sched_.renamer()->bb();
63
64 assert(!liveRange_->reads.empty());
65
66 auto rfs = sched_.renamer()->findConnectedRFs(*liveRange_, false);
67
68 bool usedAfter = true;
69 std::set<TCEString> regs;
70
71 if (!ii()) {
72
74 rfs, targetCycle_);
75 }
76
77 if (regs.empty()) {
78 usedAfter = false;
80 }
81
82 if (regs.empty()) {
83 return false;
84 }
85
86 return renameLiveRange(*liveRange_, *regs.begin(), usedAfter);
87}
#define assert(condition)
RegisterRenamer * renamer()
unsigned int ii() const
TTAProgram::BasicBlock * bb_
bool renameLiveRange(class LiveRange &liveRange, const class TCEString &reg, bool usedAfter)
TTAProgram::BasicBlock & bb()
std::set< TCEString > findFreeRegistersInRF(const RegisterFileSet &rfs) const
std::set< TCEString > findPartiallyUsedRegistersInRFAfterCycle(const RegisterFileSet &rfs, int latestCycle) const
RegisterFileSet findConnectedRFs(LiveRange &lr, bool allowLimm)

References assert, RegisterRenamer::bb(), bb_, RegisterRenamer::findConnectedRFs(), RegisterRenamer::findFreeRegistersInRF(), RegisterRenamer::findPartiallyUsedRegistersInRFAfterCycle(), BFOptimization::ii(), liveRange_, renameLiveRange(), BF2Scheduler::renamer(), BFOptimization::sched_, and targetCycle_.

Here is the call graph for this function:

◆ renameLiveRange()

bool BFRenameLiveRange::renameLiveRange ( class LiveRange liveRange,
const class TCEString reg,
bool  usedAfter 
)
protected

Definition at line 319 of file BFRenameLiveRange.cc.

320 {
321
322 bool usedBefore = false;
323
324 newReg_ = newReg;
325 oldReg_ = (*liveRange.writes.begin())->move().destination().copy();
326
327 assert(newReg.length() > 2);
328
329 if (usedAfter) {
330 TCEString rfName = newReg_.substr(0, newReg_.find('.'));
333 int newRegIndex = atoi(newReg_.substr(newReg_.find('.')+1).c_str());
334 DataDependenceGraph::NodeSet firstWrites =
335 ddg().firstScheduledRegisterWrites(*rf, newRegIndex);
336
337 // make sure no circular antidep path
338 for (auto j: firstWrites) {
339 for (auto i: liveRange.reads) {
340 if (ddg().hasPath(*j, *i)) {
341 return false;
342 }
343 }
344
345 for (auto i: liveRange.writes) {
346 if (ddg().hasPath(*j, *i)) {
347 return false;
348 }
349 }
350 }
351
352 // antideps
353 for (auto j: firstWrites) {
354 for (auto i: liveRange.writes) {
355 DataDependenceEdge* newWAW =
359 ddg().connectNodes(*i,*j, *newWAW);
360 createdAntidepEdges_.insert(newWAW);
361 }
362
363 for (auto i: liveRange.reads) {
364 DataDependenceEdge* newWAR =
368 ddg().connectNodes(*i,*j, *newWAR);
369 createdAntidepEdges_.insert(newWAR);
370 }
371 }
372 } else {
375
376
377// TODO
378#if 0
379 // need to create backedges to first if we are loop scheduling.
380 if (loopScheduling) {
381 updateAntiEdgesFromLRTo(liveRange, newReg, bb_, 1);
382 }
383#endif
384 }
385
386 if (usedBefore) {
387 return false;
388 } else {
391 }
392
393 setTerminals();
395
396 // for writes.
397 assert (liveRange_->writes.size() == 1);
398 for (auto i: liveRange_->writes) {
400 }
401
402 // for reads
403 for (auto i: liveRange_->reads) {
405 }
406
407 assert(liveRange_->guards.size() == 0);
408 // for guards
409 for (auto i: liveRange_->guards) {
411 }
412
415 return true;
416}
const TTAMachine::Machine & targetMachine() const
DataDependenceGraph::EdgeSet createdAntidepEdges_
std::map< const MoveNode *, DataDependenceGraph::UndoData, MoveNode::Comparator > undoReadUpdateData_
DataDependenceGraph::UndoData undoWriteUpdateData_
virtual void connectNodes(const Node &nTail, const Node &nHead, Edge &e)
DataDependenceGraph::UndoData sourceRenamed(MoveNode &mn)
NodeSet firstScheduledRegisterWrites(const TTAMachine::BaseRegisterFile &rf, int registerIndex) const
DataDependenceGraph::UndoData guardRenamed(MoveNode &mn)
DataDependenceGraph::UndoData destRenamed(MoveNode &mn)
void renamedToRegister(const TCEString &newReg)
ComponentType * item(int index) const
virtual RegisterFileNavigator registerFileNavigator() const
Definition Machine.cc:450
virtual Terminal * copy() const =0

References assert, bb_, BoostGraph< GraphNode, GraphEdge >::connectNodes(), TTAProgram::Terminal::copy(), createdAntidepEdges_, BFOptimization::ddg(), DataDependenceEdge::DEP_WAR, DataDependenceEdge::DEP_WAW, DataDependenceGraph::destRenamed(), DataDependenceEdge::EDGE_REGISTER, DataDependenceGraph::firstScheduledRegisterWrites(), DataDependenceGraph::guardRenamed(), BoostGraph< GraphNode, GraphEdge >::hasPath(), TTAMachine::Machine::Navigator< ComponentType >::item(), liveRange_, newReg_, notifySelector(), oldReg_, LiveRange::reads, TTAMachine::Machine::registerFileNavigator(), RegisterRenamer::renamedToRegister(), BF2Scheduler::renamer(), BFOptimization::sched_, setFirstDefsAndUses(), setIncomingDeps(), setOutgoingDeps(), setRegDefsAndLastUses(), setTerminals(), DataDependenceGraph::sourceRenamed(), BFOptimization::targetMachine(), undoReadUpdateData_, undoWriteUpdateData_, and LiveRange::writes.

Referenced by operator()().

Here is the call graph for this function:

◆ setFirstDefsAndUses()

void BFRenameLiveRange::setFirstDefsAndUses ( )
protected

Definition at line 263 of file BFRenameLiveRange.cc.

263 {
264
265 // for writing.
266 for (auto i: liveRange_->writes) {
267 MoveNodeUse mnd(*i);
269 // TODO: only if intra-bb-antideps enabled?
270// static_cast<DataDependenceGraph*>(ddg().rootGraph())->
271// updateRegWrite(mnd, newReg, *bb_);
272 }
273
274 // for reading.
275 for (auto i: liveRange_->reads) {
276 MoveNodeUse mnd(*i);
278 // no need to create raw deps here
279 }
280
281 // for guards.
282 for (auto i: liveRange_->guards) {
283 MoveNodeUse mnd(*i, true);
285 // no need to create raw deps here
286 }
287}
LiveRangeData * liveRangeData_
MoveNodeUseMapSet regFirstUses_
MoveNodeUseMapSet regFirstDefines_

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, LiveRangeData::regFirstDefines_, and LiveRangeData::regFirstUses_.

Referenced by renameLiveRange().

◆ setGuard()

void BFRenameLiveRange::setGuard ( TTAProgram::Move move,
const TTAMachine::RegisterFile rf,
int  regIndex 
)
protected

Definition at line 117 of file BFRenameLiveRange.cc.

118 {
119
120 const TTAMachine::Guard& guard = move.guard().guard();
121 TTAMachine::Bus* guardBus = guard.parentBus();
122 for (int j = 0 ; j < guardBus->guardCount(); j++) {
123 TTAMachine::Guard *g = guardBus->guard(j);
125 dynamic_cast<TTAMachine::RegisterGuard*>(g);
126 if (rg) {
127 if (rg->registerFile() == &rf &&
128 rg->registerIndex() == regIndex &&
129 rg->isInverted() == guard.isInverted()) {
130 move.setGuard(new TTAProgram::MoveGuard(*g));
131 }
132 }
133 }
134}
Guard * guard(int index) const
Definition Bus.cc:456
int guardCount() const
Definition Bus.cc:441
virtual bool isInverted() const
virtual Bus * parentBus() const
const RegisterFile * registerFile() const
const TTAMachine::Guard & guard() const
Definition MoveGuard.cc:86
MoveGuard & guard() const
Definition Move.cc:345
void setGuard(MoveGuard *guard)
Definition Move.cc:360

References TTAProgram::Move::guard(), TTAProgram::MoveGuard::guard(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::Guard::isInverted(), TTAMachine::Guard::parentBus(), TTAMachine::RegisterGuard::registerFile(), TTAMachine::RegisterGuard::registerIndex(), and TTAProgram::Move::setGuard().

Referenced by setTerminals(), and undoSetTerminal().

Here is the call graph for this function:

◆ setIncomingDeps()

void BFRenameLiveRange::setIncomingDeps ( )
protected

Definition at line 186 of file BFRenameLiveRange.cc.

186 {
187 if (liveRange_->writes.size() != 1 ||
188 !(*liveRange_->writes.begin())->move().isUnconditional()) {
189 return;
190 }
191
195}
LiveRangeData::MoveNodeUseSet oldRegFirstUses_
LiveRangeData::MoveNodeUseSet oldRegFirstDefines_
MoveNodeUseMapPair regKills_

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, oldKill_, oldRegFirstDefines_, oldRegFirstUses_, LiveRangeData::regFirstDefines_, LiveRangeData::regFirstUses_, and LiveRangeData::regKills_.

Referenced by renameLiveRange().

◆ setOutgoingDeps()

void BFRenameLiveRange::setOutgoingDeps ( )
protected

Definition at line 207 of file BFRenameLiveRange.cc.

207 {
208 if (liveRange_->writes.size() != 1 ||
209 !(*liveRange_->writes.begin())->move().isUnconditional()) {
210 return;
211 }
212
215
217 MoveNodeUse(**liveRange_->writes.begin());
219}
LiveRangeData::MoveNodeUseSet oldRegDefines_
MoveNodeUseMapPair regLastKills_
MoveNodeUseMapSet regDefines_

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, oldLastKill_, oldRegDefines_, LiveRangeData::regDefines_, and LiveRangeData::regLastKills_.

Referenced by renameLiveRange().

◆ setRegDefsAndLastUses()

void BFRenameLiveRange::setRegDefsAndLastUses ( )
protected

Definition at line 222 of file BFRenameLiveRange.cc.

222 {
223 // for writing.
224 for (auto i: liveRange_->writes) {
225 MoveNodeUse mnd(*i);
226 bb_->liveRangeData_->regDefines_[newReg_].insert(mnd);
227 }
228
229 // for reading.
230 for (auto i: liveRange_->reads) {
231 MoveNodeUse mnd(*i);
232 bb_->liveRangeData_->regLastUses_[newReg_].insert(mnd);
233 }
234
235 // for reading.
236 for (auto i: liveRange_->guards) {
237 MoveNodeUse mnd(*i, true);
238 bb_->liveRangeData_->regLastUses_[newReg_].insert(mnd);
239 }
240
241}
MoveNodeUseMapSet regLastUses_

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, LiveRangeData::regDefines_, and LiveRangeData::regLastUses_.

Referenced by renameLiveRange().

◆ setTerminals()

void BFRenameLiveRange::setTerminals ( )
protected

Definition at line 89 of file BFRenameLiveRange.cc.

89 {
90
91 TCEString rfName = newReg_.substr(0, newReg_.find('.'));
94 int newRegIndex = atoi(newReg_.substr(newReg_.find('.')+1).c_str());
95
96 // for writes.
97 for (auto i: liveRange_->writes) {
98 TTAProgram::Move& move = i->move();
100 *rf->firstWritePort(), newRegIndex));
101 }
102
103 // for reads.
104 for (auto i: liveRange_->reads) {
105 TTAProgram::Move& move = i->move();
107 *rf->firstReadPort(), newRegIndex));
108 }
109
110 // for guards.
111 for (auto i: liveRange_->guards) {
112 TTAProgram::Move& move = i->move();
113 setGuard(move, *rf, newRegIndex);
114 }
115}
void setGuard(TTAProgram::Move &move, const TTAMachine::RegisterFile &rf, int regIndex)
Port * firstReadPort() const
Port * firstWritePort() const
void setSource(Terminal *src)
Definition Move.cc:312
void setDestination(Terminal *dst)
Definition Move.cc:333

References TTAMachine::RegisterFile::firstReadPort(), TTAMachine::RegisterFile::firstWritePort(), TTAMachine::Machine::Navigator< ComponentType >::item(), liveRange_, newReg_, TTAMachine::Machine::registerFileNavigator(), TTAProgram::Move::setDestination(), setGuard(), TTAProgram::Move::setSource(), and BFOptimization::targetMachine().

Referenced by renameLiveRange().

Here is the call graph for this function:

◆ undoNewAntiDeps()

void BFRenameLiveRange::undoNewAntiDeps ( )
protected

Definition at line 179 of file BFRenameLiveRange.cc.

179 {
180 for (auto e: createdAntidepEdges_) {
181 ddg().removeEdge(*e);
182 }
183 createdAntidepEdges_.clear();
184}
virtual void removeEdge(Edge &e)

References createdAntidepEdges_, BFOptimization::ddg(), and BoostGraph< GraphNode, GraphEdge >::removeEdge().

Referenced by undoOnlyMe().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFRenameLiveRange::undoOnlyMe ( )
overrideprotectedvirtual

Undoes the operations done by this class but not children. This method should be overloaded by most derived classes.

Reimplemented from Reversible.

Definition at line 158 of file BFRenameLiveRange.cc.

158 {
159 // restore the DDG stage before the rename
160 for (auto i: undoReadUpdateData_) {
161 ddg().undo(i.second);
162 }
164
166
169
172
174
176
177}
void undo(UndoData &undoData)
void revertedRenameToRegister(const TCEString &reg)

References BFOptimization::ddg(), newReg_, BF2Scheduler::renamer(), RegisterRenamer::revertedRenameToRegister(), BFOptimization::sched_, DataDependenceGraph::undo(), undoNewAntiDeps(), undoReadUpdateData_, undoSetFirstDefsAndUses(), undoSetRegDefsAndLastUses(), undoSetTerminal(), undoWriteUpdateData_, unsetIncomingDeps(), and unsetOutgoingDeps().

Here is the call graph for this function:

◆ undoSetFirstDefsAndUses()

void BFRenameLiveRange::undoSetFirstDefsAndUses ( )
protected

Definition at line 289 of file BFRenameLiveRange.cc.

289 {
290
291 // for writing.
292 for (auto i: liveRange_->writes) {
293 MoveNodeUse mnd(*i);
295
296
297 // TODO: only if intra-bb-antideps enabled?
298// static_cast<DataDependenceGraph*>(ddg().rootGraph())->
299// updateRegWrite(mnd, newReg, *bb_);
300 }
301
302 // for reading.
303 for (auto i: liveRange_->reads) {
304 MoveNodeUse mnd(*i);
306 }
307
308 // for guards.
309 for (auto i: liveRange_->guards) {
310 MoveNodeUse mnd(*i, true);
312 }
313}

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, LiveRangeData::regFirstDefines_, and LiveRangeData::regFirstUses_.

Referenced by undoOnlyMe().

◆ undoSetRegDefsAndLastUses()

void BFRenameLiveRange::undoSetRegDefsAndLastUses ( )
protected

Definition at line 243 of file BFRenameLiveRange.cc.

243 {
244 // for writing.
245 for (auto i: liveRange_->writes) {
246 MoveNodeUse mnd(*i);
248 }
249
250 // for reading.
251 for (auto i: liveRange_->reads) {
252 MoveNodeUse mnd(*i);
254 }
255
256 // for reading.
257 for (auto i: liveRange_->guards) {
258 MoveNodeUse mnd(*i, true);
260 }
261}

References bb_, liveRange_, TTAProgram::BasicBlock::liveRangeData_, newReg_, LiveRangeData::regDefines_, and LiveRangeData::regLastUses_.

Referenced by undoOnlyMe().

◆ undoSetTerminal()

void BFRenameLiveRange::undoSetTerminal ( )
protected

Definition at line 136 of file BFRenameLiveRange.cc.

136 {
137
138 // for writes.
139 for (auto i: liveRange_->writes) {
140 TTAProgram::Move& move = i->move();
141 move.setDestination(oldReg_->copy());
142 }
143
144 // for reads.
145 for (auto i: liveRange_->reads) {
146 TTAProgram::Move& move = i->move();
147 move.setSource(oldReg_->copy());
148 }
149
150 // for guards
151 for (auto i: liveRange_->guards) {
152 TTAProgram::Move& move = i->move();
154 }
155
156}
virtual int index() const
Definition Terminal.cc:274
virtual const TTAMachine::RegisterFile & registerFile() const
Definition Terminal.cc:225

References TTAProgram::Terminal::copy(), TTAProgram::Terminal::index(), liveRange_, oldReg_, TTAProgram::Terminal::registerFile(), TTAProgram::Move::setDestination(), setGuard(), and TTAProgram::Move::setSource().

Referenced by undoOnlyMe().

Here is the call graph for this function:

◆ unsetIncomingDeps()

void BFRenameLiveRange::unsetIncomingDeps ( )
protected

◆ unsetOutgoingDeps()

void BFRenameLiveRange::unsetOutgoingDeps ( )
protected

Member Data Documentation

◆ bb_

TTAProgram::BasicBlock* BFRenameLiveRange::bb_
protected

◆ createdAntidepEdges_

DataDependenceGraph::EdgeSet BFRenameLiveRange::createdAntidepEdges_
protected

Definition at line 97 of file BFRenameLiveRange.hh.

Referenced by renameLiveRange(), and undoNewAntiDeps().

◆ liveRange_

std::shared_ptr<LiveRange> BFRenameLiveRange::liveRange_
protected

◆ newReg_

TCEString BFRenameLiveRange::newReg_
protected

◆ oldKill_

MoveNodeUse BFRenameLiveRange::oldKill_
protected

Definition at line 91 of file BFRenameLiveRange.hh.

Referenced by setIncomingDeps(), and unsetIncomingDeps().

◆ oldLastKill_

MoveNodeUse BFRenameLiveRange::oldLastKill_
protected

Definition at line 90 of file BFRenameLiveRange.hh.

Referenced by setOutgoingDeps(), and unsetOutgoingDeps().

◆ oldReg_

class TTAProgram::Terminal* BFRenameLiveRange::oldReg_
protected

Definition at line 85 of file BFRenameLiveRange.hh.

Referenced by renameLiveRange(), undoSetTerminal(), and ~BFRenameLiveRange().

◆ oldRegDefines_

LiveRangeData::MoveNodeUseSet BFRenameLiveRange::oldRegDefines_
protected

Definition at line 94 of file BFRenameLiveRange.hh.

Referenced by setOutgoingDeps(), and unsetOutgoingDeps().

◆ oldRegFirstDefines_

LiveRangeData::MoveNodeUseSet BFRenameLiveRange::oldRegFirstDefines_
protected

Definition at line 95 of file BFRenameLiveRange.hh.

Referenced by setIncomingDeps(), and unsetIncomingDeps().

◆ oldRegFirstUses_

LiveRangeData::MoveNodeUseSet BFRenameLiveRange::oldRegFirstUses_
protected

Definition at line 96 of file BFRenameLiveRange.hh.

Referenced by setIncomingDeps(), and unsetIncomingDeps().

◆ targetCycle_

int BFRenameLiveRange::targetCycle_
protected

Definition at line 92 of file BFRenameLiveRange.hh.

Referenced by operator()().

◆ undoReadUpdateData_

std::map<const MoveNode*, DataDependenceGraph::UndoData, MoveNode::Comparator> BFRenameLiveRange::undoReadUpdateData_
protected

Definition at line 83 of file BFRenameLiveRange.hh.

Referenced by renameLiveRange(), and undoOnlyMe().

◆ undoWriteUpdateData_

DataDependenceGraph::UndoData BFRenameLiveRange::undoWriteUpdateData_
protected

Definition at line 79 of file BFRenameLiveRange.hh.

Referenced by renameLiveRange(), and undoOnlyMe().


The documentation for this class was generated from the following files: