From 588193f9be52f4cfd5dc57bed599c30b5fc3697d Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Sat, 30 Sep 2023 14:02:35 +0200 Subject: [PATCH] Remove fgUpdateFlowGraph from optOptimizeFlow (#92839) --- src/coreclr/jit/optimizer.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index a583db4b3562c..11c537226e878 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -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. @@ -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; } //----------------------------------------------------------------------------- @@ -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. @@ -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; } //------------------------------------------------------------------------