Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Propagate physical promotion liveness in post-order #104554

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/coreclr/jit/promotion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 6 additions & 11 deletions src/coreclr/jit/promotionliveness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
m_hasPossibleBackEdge |= !block->IsLast() && (block->Next()->bbNum <= block->bbNum);
changed |= PerBlockLiveness(block);
}

if (!m_hasPossibleBackEdge)
for (unsigned i = 0; i < dfsTree->GetPostOrderCount(); i++)
{
break;
changed |= PerBlockLiveness(dfsTree->GetPostOrder(i));
}
} while (changed);
} while (changed && dfsTree->HasCycle());

#ifdef DEBUG
if (m_compiler->verbose)
Expand Down Expand Up @@ -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;
});

Expand All @@ -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);
Expand Down
Loading