Skip to content

Commit

Permalink
JIT: initial work on general count reconstruction (#99992)
Browse files Browse the repository at this point in the history
Implements a Gauss-Seidel solver for cases where method have irreducible loops.
  • Loading branch information
AndyAyersMS authored Mar 26, 2024
1 parent 9856094 commit ba84d1e
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 31 deletions.
12 changes: 3 additions & 9 deletions src/coreclr/jit/fgprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2949,8 +2949,8 @@ PhaseStatus Compiler::fgIncorporateProfileData()
//
if (fgPgoHaveWeights && !dataIsGood)
{
JITDUMP("\nIncorporated count data had inconsistencies; blending profile...\n");
ProfileSynthesis::Run(this, ProfileSynthesisOption::BlendLikelihoods);
JITDUMP("\nIncorporated count data had inconsistencies; repairing profile...\n");
ProfileSynthesis::Run(this, ProfileSynthesisOption::RepairLikelihoods);
}
}

Expand Down Expand Up @@ -3266,15 +3266,9 @@ class EfficientEdgeCountReconstructor : public SpanningTreeVisitor

// Are there are reparable issues with the reconstruction?
//
// Ideally we'd also have || !m_negativeCount here, but this
// leads to lots of diffs in async methods.
//
// Looks like we might first need to resolve reconstruction
// shortcomings with irreducible loops.
//
bool IsGood() const
{
return !m_entryWeightZero;
return !(m_entryWeightZero || m_negativeCount);
}

void VisitBlock(BasicBlock*) override
Expand Down
Loading

0 comments on commit ba84d1e

Please sign in to comment.