@@ -830,13 +830,6 @@ bool Compiler::fgCanCompactBlock(BasicBlock* block)
830
830
return false ;
831
831
}
832
832
833
- // We don't want to compact blocks that are in different hot/cold regions
834
- //
835
- if (fgInDifferentRegions (block, target))
836
- {
837
- return false ;
838
- }
839
-
840
833
// We cannot compact two blocks in different EH regions.
841
834
//
842
835
if (!BasicBlock::sameEHRegion (block, target))
@@ -872,6 +865,10 @@ bool Compiler::fgCanCompactBlock(BasicBlock* block)
872
865
void Compiler::fgCompactBlock (BasicBlock* block)
873
866
{
874
867
assert (fgCanCompactBlock (block));
868
+
869
+ // We shouldn't churn the flowgraph after doing hot/cold splitting
870
+ assert (fgFirstColdBlock == nullptr );
871
+
875
872
BasicBlock* const target = block->GetTarget ();
876
873
877
874
JITDUMP (" \n Compacting " FMT_BB " into " FMT_BB " :\n " , target->bbNum , block->bbNum );
@@ -1356,6 +1353,9 @@ bool Compiler::fgOptimizeEmptyBlock(BasicBlock* block)
1356
1353
{
1357
1354
assert (block->isEmpty ());
1358
1355
1356
+ // We shouldn't churn the flowgraph after doing hot/cold splitting
1357
+ assert (fgFirstColdBlock == nullptr );
1358
+
1359
1359
bool madeChanges = false ;
1360
1360
BasicBlock* bPrev = block->Prev ();
1361
1361
@@ -1401,12 +1401,6 @@ bool Compiler::fgOptimizeEmptyBlock(BasicBlock* block)
1401
1401
break ;
1402
1402
}
1403
1403
1404
- // can't allow fall through into cold code
1405
- if (block->IsLastHotBlock (this ))
1406
- {
1407
- break ;
1408
- }
1409
-
1410
1404
// Don't remove fgEntryBB
1411
1405
if (block == fgEntryBB)
1412
1406
{
@@ -5606,6 +5600,9 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
5606
5600
5607
5601
noway_assert (opts.OptimizationEnabled ());
5608
5602
5603
+ // We shouldn't be churning the flowgraph after doing hot/cold splitting
5604
+ assert (fgFirstColdBlock == nullptr );
5605
+
5609
5606
#ifdef DEBUG
5610
5607
if (verbose && !isPhase)
5611
5608
{
@@ -5762,9 +5759,7 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
5762
5759
bNext->KindIs (BBJ_ALWAYS) && // the next block is a BBJ_ALWAYS block
5763
5760
!bNext->JumpsToNext () && // and it doesn't jump to the next block (we might compact them)
5764
5761
bNext->isEmpty () && // and it is an empty block
5765
- !bNext->TargetIs (bNext) && // special case for self jumps
5766
- !bDest->IsFirstColdBlock (this ) &&
5767
- !fgInDifferentRegions (block, bDest)) // do not cross hot/cold sections
5762
+ !bNext->TargetIs (bNext)) // special case for self jumps
5768
5763
{
5769
5764
assert (block->FalseTargetIs (bNext));
5770
5765
@@ -5808,20 +5803,6 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
5808
5803
optimizeJump = false ;
5809
5804
}
5810
5805
5811
- // If we are optimizing using real profile weights
5812
- // then don't optimize a conditional jump to an unconditional jump
5813
- // until after we have computed the edge weights
5814
- //
5815
- if (fgIsUsingProfileWeights ())
5816
- {
5817
- // if block and bDest are in different hot/cold regions we can't do this optimization
5818
- // because we can't allow fall-through into the cold region.
5819
- if (fgInDifferentRegions (block, bDest))
5820
- {
5821
- optimizeJump = false ;
5822
- }
5823
- }
5824
-
5825
5806
if (optimizeJump && isJumpToJoinFree)
5826
5807
{
5827
5808
// In the join free case, we also need to move bDest right after bNext
@@ -5910,12 +5891,6 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
5910
5891
/* Mark the block as removed */
5911
5892
bNext->SetFlags (BBF_REMOVED);
5912
5893
5913
- // If this is the first Cold basic block update fgFirstColdBlock
5914
- if (bNext->IsFirstColdBlock (this ))
5915
- {
5916
- fgFirstColdBlock = bNext->Next ();
5917
- }
5918
-
5919
5894
//
5920
5895
// If we removed the end of a try region or handler region
5921
5896
// we will need to update ebdTryLast or ebdHndLast.
0 commit comments