mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
nv50/ir: Add convenience method for calculating the live sets of a function.
This commit is contained in:
parent
3e9150cd96
commit
898b0981b6
3 changed files with 12 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue