nv50/ir: Add convenience method for calculating the live sets of a function.
This commit is contained in:
committed by
Christoph Bumiller
parent
3e9150cd96
commit
898b0981b6
@@ -938,6 +938,7 @@ public:
|
||||
|
||||
inline LValue *getLValue(int id);
|
||||
|
||||
void buildLiveSets();
|
||||
void buildDefSets();
|
||||
bool convertToSSA();
|
||||
|
||||
|
||||
@@ -415,6 +415,16 @@ Function::orderInstructions(ArrayList &result)
|
||||
return result.getSize();
|
||||
}
|
||||
|
||||
void
|
||||
Function::buildLiveSets()
|
||||
{
|
||||
for (unsigned i = 0; i <= loopNestingBound; ++i)
|
||||
buildLiveSetsPreSSA(BasicBlock::get(cfg.getRoot()), cfg.nextSequence());
|
||||
|
||||
for (ArrayList::Iterator bi = allBBlocks.iterator(); !bi.end(); bi.next())
|
||||
BasicBlock::get(bi)->liveSet.marker = false;
|
||||
}
|
||||
|
||||
void
|
||||
Function::buildDefSets()
|
||||
{
|
||||
|
||||
@@ -315,13 +315,7 @@ bool
|
||||
Function::convertToSSA()
|
||||
{
|
||||
// 0. calculate live in variables (for pruned SSA)
|
||||
int seq = cfg.nextSequence();
|
||||
for (unsigned i = 0; i <= loopNestingBound; seq = cfg.nextSequence(), ++i)
|
||||
buildLiveSetsPreSSA(BasicBlock::get(cfg.getRoot()), seq);
|
||||
|
||||
// reset liveSet marker for use in regalloc
|
||||
for (ArrayList::Iterator bi = allBBlocks.iterator(); !bi.end(); bi.next())
|
||||
reinterpret_cast<BasicBlock *>(bi.get())->liveSet.marker = false;
|
||||
buildLiveSets();
|
||||
|
||||
// 1. create the dominator tree
|
||||
domTree = new DominatorTree(&cfg);
|
||||
|
||||
Reference in New Issue
Block a user