Skip to content

Commit

Permalink
JIT: Check for reachable preds in RBO (#95556)
Browse files Browse the repository at this point in the history
Nothing guarantees that all preds are reachable, in which case the
"dominates" query does not make sense.
  • Loading branch information
jakobbotsch authored Dec 4, 2023
1 parent 2c48baf commit 4bbf678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/redundantbranchopts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ bool Compiler::optJumpThreadCheck(BasicBlock* const block, BasicBlock* const dom
{
for (BasicBlock* const predBlock : block->PredBlocks())
{
if (!fgSsaDomTree->Dominates(domBlock, predBlock))
if (m_dfs->Contains(predBlock) && !fgSsaDomTree->Dominates(domBlock, predBlock))
{
JITDUMP("Dom " FMT_BB " is stale (does not dominate pred " FMT_BB "); no threading\n", domBlock->bbNum,
predBlock->bbNum);
Expand Down

0 comments on commit 4bbf678

Please sign in to comment.