Skip to content

Commit

Permalink
JIT: run instrumentation phase just after importing (#47476)
Browse files Browse the repository at this point in the history
As a prerequisite to enabling efficient instrumentation, add instrumentation
immediately after importing, so the flow graph more closely reflects the IL
level view.
  • Loading branch information
AndyAyersMS authored Jan 27, 2021
1 parent 2c4e9e0 commit 1765d03
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1765d03

Please sign in to comment.