Skip to content

Commit ba84d1e

Browse files
authored
JIT: initial work on general count reconstruction (#99992)
Implements a Gauss-Seidel solver for cases where method have irreducible loops.
1 parent 9856094 commit ba84d1e

File tree

4 files changed

+334
-31
lines changed

4 files changed

+334
-31
lines changed

src/coreclr/jit/fgprofile.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,8 +2949,8 @@ PhaseStatus Compiler::fgIncorporateProfileData()
29492949
//
29502950
if (fgPgoHaveWeights && !dataIsGood)
29512951
{
2952-
JITDUMP("\nIncorporated count data had inconsistencies; blending profile...\n");
2953-
ProfileSynthesis::Run(this, ProfileSynthesisOption::BlendLikelihoods);
2952+
JITDUMP("\nIncorporated count data had inconsistencies; repairing profile...\n");
2953+
ProfileSynthesis::Run(this, ProfileSynthesisOption::RepairLikelihoods);
29542954
}
29552955
}
29562956

@@ -3266,15 +3266,9 @@ class EfficientEdgeCountReconstructor : public SpanningTreeVisitor
32663266

32673267
// Are there are reparable issues with the reconstruction?
32683268
//
3269-
// Ideally we'd also have || !m_negativeCount here, but this
3270-
// leads to lots of diffs in async methods.
3271-
//
3272-
// Looks like we might first need to resolve reconstruction
3273-
// shortcomings with irreducible loops.
3274-
//
32753269
bool IsGood() const
32763270
{
3277-
return !m_entryWeightZero;
3271+
return !(m_entryWeightZero || m_negativeCount);
32783272
}
32793273

32803274
void VisitBlock(BasicBlock*) override

0 commit comments

Comments
 (0)