@@ -5235,8 +5235,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
5235
5235
m_pLowering->FinalizeOutgoingArgSpace ();
5236
5236
5237
5237
// We can not add any new tracked variables after this point.
5238
- lvaTrackedFixed = true ;
5239
- const unsigned numBlocksBeforeLSRA = fgBBcount;
5238
+ lvaTrackedFixed = true ;
5240
5239
5241
5240
// Now that lowering is completed we can proceed to perform register allocation
5242
5241
//
@@ -5250,8 +5249,10 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
5250
5249
5251
5250
if (opts.OptimizationEnabled ())
5252
5251
{
5253
- // LSRA may introduce new blocks. If it does, rerun layout.
5254
- if ((fgBBcount != numBlocksBeforeLSRA) && JitConfig.JitDoReversePostOrderLayout ())
5252
+ // We won't introduce new blocks from here on out,
5253
+ // so run the new block layout.
5254
+ //
5255
+ if (JitConfig.JitDoReversePostOrderLayout ())
5255
5256
{
5256
5257
auto lateLayoutPhase = [this ] {
5257
5258
fgDoReversePostOrderLayout ();
@@ -5272,7 +5273,12 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
5272
5273
DoPhase (this , PHASE_DETERMINE_FIRST_COLD_BLOCK, &Compiler::fgDetermineFirstColdBlock);
5273
5274
5274
5275
// Now that the flowgraph is finalized, run post-layout optimizations.
5276
+ //
5275
5277
DoPhase (this , PHASE_OPTIMIZE_POST_LAYOUT, &Compiler::optOptimizePostLayout);
5278
+
5279
+ // Determine start of cold region if we are hot/cold splitting
5280
+ //
5281
+ DoPhase (this , PHASE_DETERMINE_FIRST_COLD_BLOCK, &Compiler::fgDetermineFirstColdBlock);
5276
5282
}
5277
5283
5278
5284
#if FEATURE_LOOP_ALIGN
0 commit comments