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
64776477    bool                                    fgPgoSynthesized;
64786478    bool                                    fgPgoDynamic;
64796479    bool                                    fgPgoConsistent;
6480+     bool                                    fgPgoSingleEdge = false ;
64806481
64816482#ifdef  DEBUG
64826483    bool                                    fgPgoDeferredInconsistency;
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ bool Compiler::fgHaveSufficientProfileWeights()
8989        case  ICorJitInfo::PgoSource::Blend:
9090            return  true ;
9191
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+ 
9297        case  ICorJitInfo::PgoSource::Static:
9398        {
9499            //  We sometimes call this very early, eg evaluating the prejit root.
@@ -134,6 +139,12 @@ bool Compiler::fgHaveTrustedProfileWeights()
134139        case  ICorJitInfo::PgoSource::Blend:
135140        case  ICorJitInfo::PgoSource::Text:
136141            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+ 
137148        default :
138149            return  false ;
139150    }
Original file line number Diff line number Diff line change @@ -148,6 +148,17 @@ void ProfileSynthesis::Run(ProfileSynthesisOption option)
148148    m_comp->fgPgoSynthesized  = true ;
149149    m_comp->fgPgoConsistent   = !m_approximate;
150150
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+ 
151162    m_comp->Metrics .ProfileSynthesizedBlendedOrRepaired ++;
152163
153164    if  (m_approximate)
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments