File tree Expand file tree Collapse file tree 3 files changed +7
-29
lines changed Expand file tree Collapse file tree 3 files changed +7
-29
lines changed Original file line number Diff line number Diff line change @@ -5145,37 +5145,18 @@ BasicBlockVisit FlowGraphNaturalLoop::VisitLoopBlocks(TFunc func)
51455145template <typename TFunc>
51465146BasicBlockVisit FlowGraphNaturalLoop::VisitLoopBlocksLexical (TFunc func)
51475147{
5148- BasicBlock* top = m_header;
5149- unsigned numLoopBlocks = 0 ;
5150- VisitLoopBlocks ([&](BasicBlock* block) {
5151- if (block->bbNum < top->bbNum )
5152- {
5153- top = block;
5154- }
5155-
5156- numLoopBlocks++;
5157- return BasicBlockVisit::Continue;
5158- });
5148+ BasicBlock* const top = GetLexicallyTopMostBlock ();
5149+ BasicBlock* const bottom = GetLexicallyBottomMostBlock ();
51595150
5160- INDEBUG (BasicBlock* prev = nullptr );
5161- BasicBlock* cur = top;
5162- while (numLoopBlocks > 0 )
5151+ for (BasicBlock* const block : m_dfsTree->GetCompiler ()->Blocks (top, bottom))
51635152 {
5164- // If we run out of blocks the blocks aren't sequential.
5165- assert (cur != nullptr );
5166-
5167- if (ContainsBlock (cur))
5153+ if (ContainsBlock (block))
51685154 {
5169- assert ((prev == nullptr ) || (prev->bbNum < cur->bbNum ));
5170-
5171- if (func (cur) == BasicBlockVisit::Abort)
5155+ if (func (block) == BasicBlockVisit::Abort)
5156+ {
51725157 return BasicBlockVisit::Abort;
5173-
5174- INDEBUG (prev = cur);
5175- numLoopBlocks--;
5158+ }
51765159 }
5177-
5178- cur = cur->Next ();
51795160 }
51805161
51815162 return BasicBlockVisit::Continue;
Original file line number Diff line number Diff line change @@ -3064,8 +3064,6 @@ PhaseStatus Compiler::optCloneLoops()
30643064 m_dfsTree = fgComputeDfs ();
30653065 m_loops = FlowGraphNaturalLoops::Find (m_dfsTree);
30663066 }
3067-
3068- fgRenumberBlocks ();
30693067 }
30703068
30713069#ifdef DEBUG
Original file line number Diff line number Diff line change @@ -1303,7 +1303,6 @@ PhaseStatus Compiler::optUnrollLoops()
13031303 }
13041304
13051305 JITDUMP (" A nested loop was unrolled. Doing another pass (pass %d)\n " , passes + 1 );
1306- fgRenumberBlocks ();
13071306 fgInvalidateDfsTree ();
13081307 m_dfsTree = fgComputeDfs ();
13091308 m_loops = FlowGraphNaturalLoops::Find (m_dfsTree);
You can’t perform that action at this time.
0 commit comments