File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -6477,6 +6477,7 @@ class Compiler
6477
6477
bool fgPgoSynthesized;
6478
6478
bool fgPgoDynamic;
6479
6479
bool fgPgoConsistent;
6480
+ bool fgPgoSingleEdge = false ;
6480
6481
6481
6482
#ifdef DEBUG
6482
6483
bool fgPgoDeferredInconsistency;
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ bool Compiler::fgHaveSufficientProfileWeights()
89
89
case ICorJitInfo::PgoSource::Blend:
90
90
return true ;
91
91
92
+ case ICorJitInfo::PgoSource::Synthesis:
93
+ // Single-edge methods always have sufficient profile data.
94
+ // Assuming we don't synthesize value and class profile data (which we don't currently).
95
+ return fgPgoSingleEdge;
96
+
92
97
case ICorJitInfo::PgoSource::Static:
93
98
{
94
99
// We sometimes call this very early, eg evaluating the prejit root.
@@ -134,6 +139,12 @@ bool Compiler::fgHaveTrustedProfileWeights()
134
139
case ICorJitInfo::PgoSource::Blend:
135
140
case ICorJitInfo::PgoSource::Text:
136
141
return true ;
142
+
143
+ case ICorJitInfo::PgoSource::Synthesis:
144
+ // Single-edge methods with synthetic profile are trustful.
145
+ // Assuming we don't synthesize value and class profile data (which we don't currently).
146
+ return fgPgoSingleEdge;
147
+
137
148
default :
138
149
return false ;
139
150
}
Original file line number Diff line number Diff line change @@ -148,6 +148,17 @@ void ProfileSynthesis::Run(ProfileSynthesisOption option)
148
148
m_comp->fgPgoSynthesized = true ;
149
149
m_comp->fgPgoConsistent = !m_approximate;
150
150
151
+ // A simple check whether the current method has more than one edge.
152
+ m_comp->fgPgoSingleEdge = true ;
153
+ for (BasicBlock* const block : m_comp->Blocks ())
154
+ {
155
+ if (block->NumSucc () > 1 )
156
+ {
157
+ m_comp->fgPgoSingleEdge = false ;
158
+ break ;
159
+ }
160
+ }
161
+
151
162
m_comp->Metrics .ProfileSynthesizedBlendedOrRepaired ++;
152
163
153
164
if (m_approximate)
You can’t perform that action at this time.
0 commit comments