mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-10 18:11:04 +09:00
JIT: Propagate physical promotion liveness in post-order (#104554)
We now have a DFS tree available in physical promotion. This mean that like normal liveness we can maximize the information propagated on every iteration by running physical promotion's dataflow in post-order.
This commit is contained in:
parent
8b9ea5e180
commit
a0f0c6ca26
2 changed files with 6 additions and 12 deletions
|
@ -200,7 +200,6 @@ class PromotionLiveness
|
|||
unsigned* m_structLclToTrackedIndex = nullptr;
|
||||
unsigned m_numVars = 0;
|
||||
BasicBlockLiveness* m_bbInfo = nullptr;
|
||||
bool m_hasPossibleBackEdge = false;
|
||||
BitVec m_liveIn;
|
||||
BitVec m_ehLiveVars;
|
||||
JitHashTable<GenTree*, JitPtrKeyFuncs<GenTree>, BitVec> m_aggDeaths;
|
||||
|
|
|
@ -294,22 +294,19 @@ void PromotionLiveness::MarkIndex(unsigned index, bool isUse, bool isDef, BitVec
|
|||
//
|
||||
void PromotionLiveness::InterBlockLiveness()
|
||||
{
|
||||
FlowGraphDfsTree* dfsTree = m_compiler->m_dfsTree;
|
||||
assert(dfsTree != nullptr);
|
||||
|
||||
bool changed;
|
||||
do
|
||||
{
|
||||
changed = false;
|
||||
|
||||
for (BasicBlock* block = m_compiler->fgLastBB; block != nullptr; block = block->Prev())
|
||||
for (unsigned i = 0; i < dfsTree->GetPostOrderCount(); i++)
|
||||
{
|
||||
m_hasPossibleBackEdge |= !block->IsLast() && (block->Next()->bbNum <= block->bbNum);
|
||||
changed |= PerBlockLiveness(block);
|
||||
changed |= PerBlockLiveness(dfsTree->GetPostOrder(i));
|
||||
}
|
||||
|
||||
if (!m_hasPossibleBackEdge)
|
||||
{
|
||||
break;
|
||||
}
|
||||
} while (changed);
|
||||
} while (changed && dfsTree->HasCycle());
|
||||
|
||||
#ifdef DEBUG
|
||||
if (m_compiler->verbose)
|
||||
|
@ -345,7 +342,6 @@ bool PromotionLiveness::PerBlockLiveness(BasicBlock* block)
|
|||
BitVecOps::ClearD(m_bvTraits, bbInfo.LiveOut);
|
||||
block->VisitRegularSuccs(m_compiler, [=, &bbInfo](BasicBlock* succ) {
|
||||
BitVecOps::UnionD(m_bvTraits, bbInfo.LiveOut, m_bbInfo[succ->bbNum].LiveIn);
|
||||
m_hasPossibleBackEdge |= succ->bbNum <= block->bbNum;
|
||||
return BasicBlockVisit::Continue;
|
||||
});
|
||||
|
||||
|
@ -357,7 +353,6 @@ bool PromotionLiveness::PerBlockLiveness(BasicBlock* block)
|
|||
AddHandlerLiveVars(block, m_ehLiveVars);
|
||||
BitVecOps::UnionD(m_bvTraits, m_liveIn, m_ehLiveVars);
|
||||
BitVecOps::UnionD(m_bvTraits, bbInfo.LiveOut, m_ehLiveVars);
|
||||
m_hasPossibleBackEdge = true;
|
||||
}
|
||||
|
||||
bool liveInChanged = !BitVecOps::Equal(m_bvTraits, bbInfo.LiveIn, m_liveIn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue