Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Don't run fgUpdateFlowGraph after reordering blocks if using RPO-based layout #105652

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/coreclr/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,14 @@ PhaseStatus Compiler::optOptimizeLayout()

fgUpdateFlowGraph(/* doTailDuplication */ false);
fgReorderBlocks(/* useProfile */ true);
fgUpdateFlowGraph(/* doTailDuplication */ false, /* isPhase */ false);

// The RPO-based layout does not introduce new blocks,
// so we don't need to run fgUpdateFlowGraph again.
//
if (!JitConfig.JitDoReversePostOrderLayout())
{
fgUpdateFlowGraph(/* doTailDuplication */ false, /* isPhase */ false);
}

// fgReorderBlocks can cause IR changes even if it does not modify
// the flow graph. It calls gtPrepareCost which can cause operand swapping.
Expand Down
Loading