Skip to content

Commit

Permalink
Remove fgUpdateFlowGraph from optOptimizeFlow (#92839)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Sep 30, 2023
1 parent a2818c5 commit 588193f
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/coreclr/jit/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5350,11 +5350,8 @@ PhaseStatus Compiler::optOptimizeFlow()
noway_assert(opts.OptimizationEnabled());
noway_assert(fgModified == false);

bool madeChanges = false;

madeChanges |= fgUpdateFlowGraph(/* allowTailDuplication */ true);
madeChanges |= fgReorderBlocks(/* useProfileData */ false);
madeChanges |= fgUpdateFlowGraph();
fgUpdateFlowGraph(/* doTailDuplication */ true);
fgReorderBlocks(/* useProfile */ false);

// fgReorderBlocks can cause IR changes even if it does not modify
// the flow graph. It calls gtPrepareCost which can cause operand swapping.
Expand All @@ -5363,9 +5360,7 @@ PhaseStatus Compiler::optOptimizeFlow()
// Note phase status only impacts dumping and checking done post-phase,
// it has no impact on a release build.
//
madeChanges = true;

return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
return PhaseStatus::MODIFIED_EVERYTHING;
}

//-----------------------------------------------------------------------------
Expand All @@ -5381,11 +5376,9 @@ PhaseStatus Compiler::optOptimizeLayout()
{
noway_assert(opts.OptimizationEnabled());

bool madeChanges = false;

madeChanges |= fgUpdateFlowGraph(/* allowTailDuplication */ false);
madeChanges |= fgReorderBlocks(/* useProfile */ true);
madeChanges |= fgUpdateFlowGraph();
fgUpdateFlowGraph(/* doTailDuplication */ false);
fgReorderBlocks(/* useProfile */ true);
fgUpdateFlowGraph();

// fgReorderBlocks can cause IR changes even if it does not modify
// the flow graph. It calls gtPrepareCost which can cause operand swapping.
Expand All @@ -5394,9 +5387,7 @@ PhaseStatus Compiler::optOptimizeLayout()
// Note phase status only impacts dumping and checking done post-phase,
// it has no impact on a release build.
//
madeChanges = true;

return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
return PhaseStatus::MODIFIED_EVERYTHING;
}

//------------------------------------------------------------------------
Expand Down

0 comments on commit 588193f

Please sign in to comment.