Skip to content

Commit 1765d03

Browse files
authored
JIT: run instrumentation phase just after importing (#47476)
As a prerequisite to enabling efficient instrumentation, add instrumentation immediately after importing, so the flow graph more closely reflects the IL level view.
1 parent 2c4e9e0 commit 1765d03

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/coreclr/jit/compiler.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4420,6 +4420,13 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags
44204420
//
44214421
DoPhase(this, PHASE_IMPORTATION, &Compiler::fgImport);
44224422

4423+
// If instrumenting, add block and class probes.
4424+
//
4425+
if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR))
4426+
{
4427+
DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod);
4428+
}
4429+
44234430
// Transform indirect calls that require control flow expansion.
44244431
//
44254432
DoPhase(this, PHASE_INDXCALL, &Compiler::fgTransformIndirectCalls);
@@ -4494,11 +4501,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags
44944501
fgRemoveEH();
44954502
#endif // !FEATURE_EH
44964503

4497-
if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR))
4498-
{
4499-
DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod);
4500-
}
4501-
45024504
// We could allow ESP frames. Just need to reserve space for
45034505
// pushing EBP if the method becomes an EBP-frame after an edit.
45044506
// Note that requiring a EBP Frame disallows double alignment. Thus if we change this

0 commit comments

Comments
 (0)