nv50/ir: Add convenience method for calculating the live sets of a function.

This commit is contained in:
Francisco Jerez 2011-11-15 02:07:21 +01:00 committed by Christoph Bumiller
parent 3e9150cd96
commit 898b0981b6
3 changed files with 12 additions and 7 deletions

View file

@ -938,6 +938,7 @@ public:
inline LValue *getLValue(int id);
void buildLiveSets();
void buildDefSets();
bool convertToSSA();

View file

@ -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()
{

View file

@ -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);