Skip to content

Commit

Permalink
JIT: Remove OSR quirk in fgOptimizeUncondBranchToSimpleCond (dotnet…
Browse files Browse the repository at this point in the history
…#111936)

Looks like a relic from when loop recognition was lexical.
  • Loading branch information
amanasifkhalid authored Jan 29, 2025
1 parent 3e32e51 commit c5921ed
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2213,27 +2213,6 @@ bool Compiler::fgOptimizeUncondBranchToSimpleCond(BasicBlock* block, BasicBlock*
// At this point we know target is BBJ_COND.
assert(target->KindIs(BBJ_COND));

// Bail out if OSR, as we can have unusual flow into loops. If one
// of target's successors is also a backedge target, this optimization
// may mess up loop recognition by creating too many non-loop preds.
//
if (opts.IsOSR())
{
if (target->GetFalseTarget()->HasFlag(BBF_BACKWARD_JUMP_TARGET))
{
JITDUMP("Deferring: " FMT_BB " --> " FMT_BB "; latter looks like loop top\n", target->bbNum,
target->GetFalseTarget()->bbNum);
return false;
}

if (target->GetTrueTarget()->HasFlag(BBF_BACKWARD_JUMP_TARGET))
{
JITDUMP("Deferring: " FMT_BB " --> " FMT_BB "; latter looks like loop top\n", target->bbNum,
target->GetTrueTarget()->bbNum);
return false;
}
}

// See if this block assigns constant or other interesting tree to that same local.
//
if (!fgBlockEndFavorsTailDuplication(block, lclNum))
Expand Down

0 comments on commit c5921ed

Please sign in to comment.