diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 3295e00236f8cb..57e90653c737c7 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -2219,9 +2219,6 @@ class FlowGraphNaturalLoop template BasicBlockVisit VisitLoopBlocks(TFunc func); - template - BasicBlockVisit VisitLoopBlocksLexical(TFunc func); - template BasicBlockVisit VisitRegularExitBlocks(TFunc func); diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 4355eda65cf307..38fa10167c48a9 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -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 -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. diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp index 91d62de8316b75..a90bf9c3f00e9d 100644 --- a/src/coreclr/jit/flowgraph.cpp +++ b/src/coreclr/jit/flowgraph.cpp @@ -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); @@ -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))