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: Remove VisitLoopBlocksLexical utility #110490

Merged
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
3 changes: 0 additions & 3 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2219,9 +2219,6 @@ class FlowGraphNaturalLoop
template<typename TFunc>
BasicBlockVisit VisitLoopBlocks(TFunc func);

template<typename TFunc>
BasicBlockVisit VisitLoopBlocksLexical(TFunc func);

template<typename TFunc>
BasicBlockVisit VisitRegularExitBlocks(TFunc func);

Expand Down
35 changes: 0 additions & 35 deletions src/coreclr/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5127,41 +5127,6 @@ BasicBlockVisit FlowGraphNaturalLoop::VisitLoopBlocks(TFunc func)
return VisitLoopBlocksReversePostOrder(func);
}

//------------------------------------------------------------------------------
// FlowGraphNaturalLoop::VisitLoopBlocksLexical: Visit the loop's blocks in
// lexical order.
//
// Type parameters:
// TFunc - Callback functor type
//
// Arguments:
// func - Callback functor that takes a BasicBlock* and returns a
// BasicBlockVisit.
//
// Returns:
// BasicBlockVisit that indicated whether the visit was aborted by the
// callback or whether all blocks were visited.
//
template <typename TFunc>
BasicBlockVisit FlowGraphNaturalLoop::VisitLoopBlocksLexical(TFunc func)
{
BasicBlock* const top = GetLexicallyTopMostBlock();
BasicBlock* const bottom = GetLexicallyBottomMostBlock();

for (BasicBlock* const block : m_dfsTree->GetCompiler()->Blocks(top, bottom))
{
if (ContainsBlock(block))
{
if (func(block) == BasicBlockVisit::Abort)
{
return BasicBlockVisit::Abort;
}
}
}

return BasicBlockVisit::Continue;
}

//------------------------------------------------------------------------------
// FlowGraphNaturalLoop::VisitRegularExitBlocks: Visit non-handler blocks that
// are outside the loop but that may have regular predecessors inside the loop.
Expand Down
6 changes: 2 additions & 4 deletions src/coreclr/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6001,9 +6001,7 @@ void FlowGraphNaturalLoop::Duplicate(BasicBlock** insertAfter, BlockToBlockMap*

Compiler* comp = m_dfsTree->GetCompiler();

BasicBlock* bottom = GetLexicallyBottomMostBlock();

VisitLoopBlocksLexical([=](BasicBlock* blk) {
VisitLoopBlocks([=](BasicBlock* blk) {
// Initialize newBlk as BBJ_ALWAYS without jump target, and fix up jump target later
// with BasicBlock::CopyTarget().
BasicBlock* newBlk = comp->fgNewBBafter(BBJ_ALWAYS, *insertAfter, /*extendRegion*/ true);
Expand Down Expand Up @@ -6213,7 +6211,7 @@ void FlowGraphNaturalLoop::DuplicateWithEH(BasicBlock** insertAfter, BlockToBloc
BitVecTraits traits(comp->compBasicBlockID, comp);
BitVec visited(BitVecOps::MakeEmpty(&traits));

VisitLoopBlocksLexical([=, &traits, &visited, &clonedTry, &ehIndexShift](BasicBlock* blk) {
VisitLoopBlocks([=, &traits, &visited, &clonedTry, &ehIndexShift](BasicBlock* blk) {
// Try cloning may have already handled this block
//
if (BitVecOps::IsMember(&traits, visited, blk->bbID))
Expand Down
Loading