Skip to content

Commit

Permalink
Metrics for ref positions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbotsch committed May 1, 2024
1 parent 017593d commit c52c798
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/coreclr/jit/jitmetadatalist.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ JITMETADATAMETRIC(ProfileInconsistentImporterBranchFold, int, 0)
JITMETADATAMETRIC(ProfileInconsistentImporterSwitchFold, int, 0)
JITMETADATAMETRIC(ProfileInconsistentChainedGDV, int, 0)
JITMETADATAMETRIC(ProfileInconsistentScratchBB, int, 0)
JITMETADATAMETRIC(NumRefTypeInvalid, int, 0)
JITMETADATAMETRIC(NumRefTypeDef, int, 0)
JITMETADATAMETRIC(NumRefTypeUse, int, 0)
JITMETADATAMETRIC(NumRefTypeKill, int, 0)
JITMETADATAMETRIC(NumRefTypeBB, int, 0)
JITMETADATAMETRIC(NumRefTypeFixedReg, int, 0)
JITMETADATAMETRIC(NumRefTypeExpUse, int, 0)
JITMETADATAMETRIC(NumRefTypeParamDef, int, 0)
JITMETADATAMETRIC(NumRefTypeDummyDef, int, 0)
JITMETADATAMETRIC(NumRefTypeZeroInit, int, 0)
JITMETADATAMETRIC(NumRefTypeUpperVectorSave, int, 0)
JITMETADATAMETRIC(NumRefTypeUpperVectorRestore, int, 0)
JITMETADATAMETRIC(NumRefTypeKillGCRefs, int, 0)


#undef JITMETADATA
#undef JITMETADATAINFO
Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/jit/lsrabuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ RefPosition* LinearScan::newRefPositionRaw(LsraLocation nodeLocation, GenTree* t
assert(!((refType == RefTypeParamDef) || (refType == RefTypeZeroInit) || (refType == RefTypeDummyDef) ||
(refType == RefTypeExpUse)));
}

switch (refType)
{
#define DEF_REFTYPE(name, x, y) case name: compiler->Metrics.Num ## name++; break;
#include "lsra_reftypes.h"
}
#endif // DEBUG
return newRP;
}
Expand Down

0 comments on commit c52c798

Please sign in to comment.