Skip to content

Commit 49a83ae

Browse files
authored
JIT: suppress edge weight second computation pass (#46779)
Follow up to #45615. We compute edge weights twice. Make sure we either enable or suppress both the computations.
1 parent 1fb9556 commit 49a83ae

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/coreclr/jit/flowgraph.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13567,7 +13567,6 @@ void Compiler::fgComputeBlockAndEdgeWeights()
1356713567
JITDUMP("*************** In fgComputeBlockAndEdgeWeights()\n");
1356813568

1356913569
const bool usingProfileWeights = fgIsUsingProfileWeights();
13570-
const bool isOptimizing = opts.OptimizationEnabled();
1357113570

1357213571
fgModified = false;
1357313572
fgHaveValidEdgeWeights = false;
@@ -13592,14 +13591,7 @@ void Compiler::fgComputeBlockAndEdgeWeights()
1359213591
JITDUMP(" -- no profile data, so using default called count\n");
1359313592
}
1359413593

13595-
if (usingProfileWeights && isOptimizing)
13596-
{
13597-
fgComputeEdgeWeights();
13598-
}
13599-
else
13600-
{
13601-
JITDUMP(" -- not optimizing or no profile data, so not computing edge weights\n");
13602-
}
13594+
fgComputeEdgeWeights();
1360313595
}
1360413596

1360513597
//-------------------------------------------------------------
@@ -13806,6 +13798,15 @@ void Compiler::fgComputeCalledCount(BasicBlock::weight_t returnWeight)
1380613798

1380713799
void Compiler::fgComputeEdgeWeights()
1380813800
{
13801+
const bool isOptimizing = opts.OptimizationEnabled();
13802+
const bool usingProfileWeights = fgIsUsingProfileWeights();
13803+
13804+
if (!isOptimizing || !usingProfileWeights)
13805+
{
13806+
JITDUMP(" -- not optimizing or no profile data, so not computing edge weights\n");
13807+
return;
13808+
}
13809+
1380913810
BasicBlock* bSrc;
1381013811
BasicBlock* bDst;
1381113812
flowList* edge;

0 commit comments

Comments
 (0)