Skip to content

Commit

Permalink
JIT: don't compute edge weights when there's no profile data (#45615)
Browse files Browse the repository at this point in the history
We don't look edge the weights unless there's profile data, so only compute
edge weights if there is profile data.

Saves a tiny bit on TP (~0.2%).
  • Loading branch information
AndyAyersMS authored Dec 5, 2020
1 parent c2404a9 commit 29325a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/src/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13527,13 +13527,13 @@ void Compiler::fgComputeBlockAndEdgeWeights()
JITDUMP(" -- no profile data, so using default called count\n");
}

if (isOptimizing)
if (usingProfileWeights && isOptimizing)
{
fgComputeEdgeWeights();
}
else
{
JITDUMP(" -- not optimizing, so not computing edge weights\n");
JITDUMP(" -- not optimizing or no profile data, so not computing edge weights\n");
}
}

Expand Down

0 comments on commit 29325a6

Please sign in to comment.