Skip to content

Commit

Permalink
Don't reorder blocks too early in helper call expansion (#84765)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Apr 13, 2023
1 parent 20de7f0 commit 51c0342
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/coreclr/jit/helperexpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,6 @@ bool Compiler::fgExpandRuntimeLookupsForCall(BasicBlock* block, Statement* stmt,
{
assert(BasicBlock::sameEHRegion(prevBb, sizeCheckBb));
}

if (opts.OptimizationEnabled())
{
fgReorderBlocks(/* useProfileData */ false);
fgUpdateChangedFlowGraph(FlowGraphUpdates::COMPUTE_BASICS);
}
return true;
}

Expand Down Expand Up @@ -674,9 +668,6 @@ bool Compiler::fgExpandThreadLocalAccessForCall(BasicBlock* block, Statement* st
assert(BasicBlock::sameEHRegion(prevBb, threadStaticBlockNullCondBB));
assert(BasicBlock::sameEHRegion(prevBb, fastPathBb));

fgReorderBlocks(/* useProfileData */ false);
fgUpdateChangedFlowGraph(FlowGraphUpdates::COMPUTE_BASICS);

return true;
}

Expand Down Expand Up @@ -704,6 +695,13 @@ PhaseStatus Compiler::fgExpandHelper(bool skipRarelyRunBlocks)
result = PhaseStatus::MODIFIED_EVERYTHING;
}
}

if ((result == PhaseStatus::MODIFIED_EVERYTHING) && opts.OptimizationEnabled())
{
fgReorderBlocks(/* useProfileData */ false);
fgUpdateChangedFlowGraph(FlowGraphUpdates::COMPUTE_BASICS);
}

return result;
}

Expand Down

0 comments on commit 51c0342

Please sign in to comment.