src/coreclr/src/jit/phase.cpp
//------------------------------------------------------------------------
// PostPhase: perform dumps and checks after a phase executes
//
perform dumps and checks after a phase executes
perform dumps and checks after a phase executes
void Phase::PostPhase()
{
#ifdef DEBUG
     As we remove the explicit checks and dumps from each phase, we
     will add to thist list; once all phases are updated, we can
     remove the list entirely.
     Currently the list is just the set of phases that have custom
     derivations from the Phase class.
    static Phases s_whitelist[] = {PHASE_ALLOCATE_OBJECTS, PHASE_BUILD_SSA, PHASE_RATIONALIZE, PHASE_LOWERING,
                                   PHASE_STACK_LEVEL_SETTER};
    bool doPostPhase = false;
    for (int i = 0; i < sizeof(s_whitelist) / sizeof(Phases); i++)
    {
        if (m_phase == s_whitelist[i])
        {
            doPostPhase = true;
            break;
        }
    }
    if (VERBOSE)
    {
        if (comp->compIsForInlining())
        {
            printf("\n*************** Inline @[%06u] Finishing PHASE %s\n",
                   Compiler::dspTreeID(comp->impInlineInfo->iciCall), m_name);
        }
        else
        {
            printf("\n*************** Finishing PHASE %s\n", m_name);
        }
        if (doPostPhase)
        {
            printf("Trees after %s\n", m_name);
            comp->fgDispBasicBlocks(true);
        }
#if DUMP_FLOWGRAPHS
        comp->fgDumpFlowGraph(m_phase);
#endif  DUMP_FLOWGRAPHS
    }
    if (doPostPhase)
    {
        if (comp->activePhaseChecks == PhaseChecks::CHECK_ALL)
        {
            comp->fgDebugCheckBBlist();
            comp->fgDebugCheckLinks();
            comp->fgDebugCheckNodesUniqueness();
        }
    }
#endif  DEBUG
    comp->EndPhase(m_phase);
}
void Phase :: PostPhase ( ) { #ifdef DEBUG static Phases s_whitelist [ ] = { PHASE_ALLOCATE_OBJECTS , PHASE_BUILD_SSA , PHASE_RATIONALIZE , PHASE_LOWERING , PHASE_STACK_LEVEL_SETTER } ; bool doPostPhase = false ; for ( int i = 0 ; i < sizeof ( s_whitelist ) / sizeof ( Phases ) ; i ++ ) { if ( m_phase == s_whitelist [ i ] ) { doPostPhase = true ; break ; } } if ( VERBOSE ) { if ( comp -> compIsForInlining ( ) ) { printf ( " \n \n " , Compiler :: dspTreeID ( comp -> impInlineInfo -> iciCall ) , m_name ) ; } else { printf ( " \n \n " , m_name ) ; } if ( doPostPhase ) { printf ( " \n " , m_name ) ; comp -> fgDispBasicBlocks ( true ) ; } #if DUMP_FLOWGRAPHS comp -> fgDumpFlowGraph ( m_phase ) ; #endif } if ( doPostPhase ) { if ( comp -> activePhaseChecks == PhaseChecks :: CHECK_ALL ) { comp -> fgDebugCheckBBlist ( ) ; comp -> fgDebugCheckLinks ( ) ; comp -> fgDebugCheckNodesUniqueness ( ) ; } } #endif comp -> EndPhase ( m_phase ) ; }
PostPhase: perform dumps and checks after a phase executes
PostPhase : perform dumps and checks after a phase executes
// To help in the incremental conversion of jit activity to phases // without greatly increasing dump size or checked jit time, we // currently whitelist the phases that do post-phase checks and // dumps via the phase object, and not via explicit calls from // the various methods in the phase. // // As we remove the explicit checks and dumps from each phase, we // will add to thist list; once all phases are updated, we can // remove the list entirely. // // Currently the list is just the set of phases that have custom // derivations from the Phase class. // DUMP_FLOWGRAPHS // DEBUG