Skip to content

Commit

Permalink
JIT: Skip moving BBJ_COND jump target if fallthrough target is equall…
Browse files Browse the repository at this point in the history
…y likely (dotnet#105084)
  • Loading branch information
amanasifkhalid authored Jul 18, 2024
1 parent 7cdd2e9 commit c707913
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4536,6 +4536,13 @@ void Compiler::fgMoveHotJumps()
targetEdge = block->GetFalseEdge();
unlikelyEdge = block->GetTrueEdge();
}

// If we aren't sure which successor is hotter, and we already fall into one of them,
// do nothing
if ((unlikelyEdge->getLikelihood() == 0.5) && block->NextIs(unlikelyEdge->getDestinationBlock()))
{
continue;
}
}
else
{
Expand Down

0 comments on commit c707913

Please sign in to comment.