Skip to content

Commit b148ab8

Browse files
AndyAyersMSpull[bot]
authored andcommitted
JIT: fix STRESS_BB_PROFILE issue (#101925)
Incorporate "stress" profile counts even if we're not optimizing. Scale after synthesis, not before. Fixes #101901.
1 parent 619dff1 commit b148ab8

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/coreclr/jit/fgprofile.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,22 +2846,14 @@ PhaseStatus Compiler::fgInstrumentMethod()
28462846
//
28472847
PhaseStatus Compiler::fgIncorporateProfileData()
28482848
{
2849-
// For now we only rely on profile data when optimizing.
2850-
//
2851-
if (!opts.OptimizationEnabled())
2852-
{
2853-
JITDUMP("not optimizing, so not incorporating any profile data\n");
2854-
return PhaseStatus::MODIFIED_NOTHING;
2855-
}
2856-
28572849
// Are we doing profile stress?
28582850
//
28592851
if (fgStressBBProf() > 0)
28602852
{
28612853
JITDUMP("JitStress -- incorporating random profile data\n");
28622854
fgIncorporateBlockCounts();
2863-
fgApplyProfileScale();
28642855
ProfileSynthesis::Run(this, ProfileSynthesisOption::RepairLikelihoods);
2856+
fgApplyProfileScale();
28652857
return PhaseStatus::MODIFIED_EVERYTHING;
28662858
}
28672859

@@ -2882,6 +2874,7 @@ PhaseStatus Compiler::fgIncorporateProfileData()
28822874
{
28832875
JITDUMP("Synthesizing profile data\n");
28842876
ProfileSynthesis::Run(this, ProfileSynthesisOption::AssignLikelihoods);
2877+
fgApplyProfileScale();
28852878
return PhaseStatus::MODIFIED_EVERYTHING;
28862879
}
28872880
}
@@ -2893,6 +2886,7 @@ PhaseStatus Compiler::fgIncorporateProfileData()
28932886
{
28942887
JITDUMP("Synthesizing profile data and writing it out as the actual profile data\n");
28952888
ProfileSynthesis::Run(this, ProfileSynthesisOption::AssignLikelihoods);
2889+
fgApplyProfileScale();
28962890
return PhaseStatus::MODIFIED_EVERYTHING;
28972891
}
28982892
#endif

0 commit comments

Comments
 (0)