Skip to content

Commit c707913

Browse files
JIT: Skip moving BBJ_COND jump target if fallthrough target is equally likely (#105084)
1 parent 7cdd2e9 commit c707913

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/coreclr/jit/fgopt.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4536,6 +4536,13 @@ void Compiler::fgMoveHotJumps()
45364536
targetEdge = block->GetFalseEdge();
45374537
unlikelyEdge = block->GetTrueEdge();
45384538
}
4539+
4540+
// If we aren't sure which successor is hotter, and we already fall into one of them,
4541+
// do nothing
4542+
if ((unlikelyEdge->getLikelihood() == 0.5) && block->NextIs(unlikelyEdge->getDestinationBlock()))
4543+
{
4544+
continue;
4545+
}
45394546
}
45404547
else
45414548
{

0 commit comments

Comments
 (0)