Skip to content

Commit

Permalink
JIT: build pred lists before instrumentation (#81288)
Browse files Browse the repository at this point in the history
Move pred list building to just before instrumentation (and just after
importation -- we are getting very close to the front of the phase list now).

The block and edge count instrumenters were both using cheap preds to keep
track of some relocated count probes. Revise this so they can use the regular
pred lists. Also rework both approaches so their `RelocateProbes` methods are
fairly similar and perhaps could be unified one day.

Contributes to #80193.
  • Loading branch information
AndyAyersMS committed Jan 30, 2023
1 parent 3c76e14 commit b6935d3
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 302 deletions.
14 changes: 7 additions & 7 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4425,13 +4425,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
return;
}

// If instrumenting, add block and class probes.
//
if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR))
{
DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod);
}

// Compute bbNum, bbRefs and bbPreds
//
// This is the first time full (not cheap) preds will be computed.
Expand All @@ -4449,6 +4442,13 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
};
DoPhase(this, PHASE_COMPUTE_PREDS, computePredsPhase);

// If instrumenting, add block and class probes.
//
if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR))
{
DoPhase(this, PHASE_IBCINSTR, &Compiler::fgInstrumentMethod);
}

// Expand any patchpoints
//
DoPhase(this, PHASE_PATCHPOINTS, &Compiler::fgTransformPatchpoints);
Expand Down
Loading

0 comments on commit b6935d3

Please sign in to comment.