Skip to content

Commit ba6fb5d

Browse files
authored
JIT: refactor instrumentation code (#47509)
Refactor `fgInstrument` and related methods and classes, so that the strategies for block and class instrumentation are clearly separated out, and can be varied.
1 parent e4dc8ee commit ba6fb5d

File tree

4 files changed

+560
-311
lines changed

4 files changed

+560
-311
lines changed

src/coreclr/jit/block.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,16 @@ struct BasicBlock : private LIR::Range
726726
};
727727

728728
#define NO_BASE_TMP UINT_MAX // base# to use when we have none
729-
unsigned bbStkTempsIn; // base# for input stack temps
730-
unsigned bbStkTempsOut; // base# for output stack temps
729+
730+
union {
731+
unsigned bbStkTempsIn; // base# for input stack temps
732+
int bbCountSchemaIndex; // schema index for count instrumentation
733+
};
734+
735+
union {
736+
unsigned bbStkTempsOut; // base# for output stack temps
737+
int bbClassSchemaIndex; // schema index for class instrumentation
738+
};
731739

732740
#define MAX_XCPTN_INDEX (USHRT_MAX - 1)
733741

src/coreclr/jit/compiler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5586,15 +5586,14 @@ class Compiler
55865586
#endif
55875587

55885588
public:
5589+
Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree);
55895590
void fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt);
55905591
Statement* fgNewStmtAtEnd(BasicBlock* block, GenTree* tree);
55915592
Statement* fgNewStmtNearEnd(BasicBlock* block, GenTree* tree);
55925593

55935594
private:
55945595
void fgInsertStmtNearEnd(BasicBlock* block, Statement* stmt);
55955596
void fgInsertStmtAtBeg(BasicBlock* block, Statement* stmt);
5596-
Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree);
5597-
55985597
void fgInsertStmtAfter(BasicBlock* block, Statement* insertionPoint, Statement* stmt);
55995598

56005599
public:

src/coreclr/jit/compmemkind.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ CompMemKindMacro(ClassLayout)
5858
CompMemKindMacro(TailMergeThrows)
5959
CompMemKindMacro(EarlyProp)
6060
CompMemKindMacro(ZeroInit)
61+
CompMemKindMacro(Pgo)
6162
//clang-format on
6263

6364
#undef CompMemKindMacro

0 commit comments

Comments
 (0)