diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index efdf66d864b35..036642e254f2b 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -4420,6 +4420,13 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags // DoPhase(this, PHASE_IMPORTATION, &Compiler::fgImport); + // If instrumenting, add block and class probes. + // + if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)) + { + DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod); + } + // Transform indirect calls that require control flow expansion. // DoPhase(this, PHASE_INDXCALL, &Compiler::fgTransformIndirectCalls); @@ -4494,11 +4501,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags fgRemoveEH(); #endif // !FEATURE_EH - if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)) - { - DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod); - } - // We could allow ESP frames. Just need to reserve space for // pushing EBP if the method becomes an EBP-frame after an edit. // Note that requiring a EBP Frame disallows double alignment. Thus if we change this