Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,7 @@ bool Compiler::fgExpandRarelyRunBlocks()
break;

case BBJ_COND:
if (block->isRunRarely() && bPrev->GetTrueTarget()->isRunRarely())
if (bPrev->GetTrueTarget()->isRunRarely() && bPrev->GetFalseTarget()->isRunRarely())
{
INDEBUG(reason = "Both sides of a conditional jump are rarely run");
setRarelyRun = true;
Expand Down Expand Up @@ -3230,21 +3230,13 @@ bool Compiler::fgExpandRarelyRunBlocks()
}
}

/* COMPACT blocks if possible */
if (fgCanCompactBlock(bPrev))
{
fgCompactBlock(bPrev);

block = bPrev;
continue;
}
//
// if bPrev->bbWeight is not based upon profile data we can adjust
// the weights of bPrev and block
//
else if (bPrev->isBBCallFinallyPair() && // we must have a BBJ_CALLFINALLY and BBJ_CALLFINALLYRET pair
(bPrev->bbWeight != block->bbWeight) && // the weights are currently different
!bPrev->hasProfileWeight()) // and the BBJ_CALLFINALLY block is not using profiled weights
if (bPrev->isBBCallFinallyPair() && // we must have a BBJ_CALLFINALLY and BBJ_CALLFINALLYRET pair
(bPrev->bbWeight != block->bbWeight) && // the weights are currently different
!bPrev->hasProfileWeight()) // and the BBJ_CALLFINALLY block is not using profiled weights
{
if (block->isRunRarely())
{
Expand Down