Skip to content

Commit 1584559

Browse files
amanasifkhalidpull[bot]
authored andcommitted
JIT: Skip moving BBJ_COND jump target if fallthrough target is equally likely (#105084)
1 parent 132c040 commit 1584559

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎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)