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)
5145
5145
template <typename TFunc>
5146
5146
BasicBlockVisit FlowGraphNaturalLoop::VisitLoopBlocksLexical (TFunc func)
5147
5147
{
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 ();
5159
5150
5160
- INDEBUG (BasicBlock* prev = nullptr );
5161
- BasicBlock* cur = top;
5162
- while (numLoopBlocks > 0 )
5151
+ for (BasicBlock* const block : m_dfsTree->GetCompiler ()->Blocks (top, bottom))
5163
5152
{
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))
5168
5154
{
5169
- assert ((prev == nullptr ) || (prev->bbNum < cur->bbNum ));
5170
-
5171
- if (func (cur) == BasicBlockVisit::Abort)
5155
+ if (func (block) == BasicBlockVisit::Abort)
5156
+ {
5172
5157
return BasicBlockVisit::Abort;
5173
-
5174
- INDEBUG (prev = cur);
5175
- numLoopBlocks--;
5158
+ }
5176
5159
}
5177
-
5178
- cur = cur->Next ();
5179
5160
}
5180
5161
5181
5162
return BasicBlockVisit::Continue;
Original file line number Diff line number Diff line change @@ -3064,8 +3064,6 @@ PhaseStatus Compiler::optCloneLoops()
3064
3064
m_dfsTree = fgComputeDfs ();
3065
3065
m_loops = FlowGraphNaturalLoops::Find (m_dfsTree);
3066
3066
}
3067
-
3068
- fgRenumberBlocks ();
3069
3067
}
3070
3068
3071
3069
#ifdef DEBUG
Original file line number Diff line number Diff line change @@ -1303,7 +1303,6 @@ PhaseStatus Compiler::optUnrollLoops()
1303
1303
}
1304
1304
1305
1305
JITDUMP (" A nested loop was unrolled. Doing another pass (pass %d)\n " , passes + 1 );
1306
- fgRenumberBlocks ();
1307
1306
fgInvalidateDfsTree ();
1308
1307
m_dfsTree = fgComputeDfs ();
1309
1308
m_loops = FlowGraphNaturalLoops::Find (m_dfsTree);
You can’t perform that action at this time.
0 commit comments