@@ -5235,8 +5235,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
52355235 m_pLowering->FinalizeOutgoingArgSpace ();
52365236
52375237 // We can not add any new tracked variables after this point.
5238- lvaTrackedFixed = true ;
5239- const unsigned numBlocksBeforeLSRA = fgBBcount;
5238+ lvaTrackedFixed = true ;
52405239
52415240 // Now that lowering is completed we can proceed to perform register allocation
52425241 //
@@ -5250,8 +5249,10 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
52505249
52515250 if (opts.OptimizationEnabled ())
52525251 {
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 ())
52555256 {
52565257 auto lateLayoutPhase = [this ] {
52575258 fgDoReversePostOrderLayout ();
@@ -5272,7 +5273,12 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
52725273 DoPhase (this , PHASE_DETERMINE_FIRST_COLD_BLOCK, &Compiler::fgDetermineFirstColdBlock);
52735274
52745275 // Now that the flowgraph is finalized, run post-layout optimizations.
5276+ //
52755277 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);
52765282 }
52775283
52785284#if FEATURE_LOOP_ALIGN
0 commit comments