Skip to content

JIT differences in reporting call sites in GC info #103917

@jakobbotsch

Description

@jakobbotsch

The JIT has an optimization for MinOpts compilations where we do not bother reporting call sites at all:

if (noTrackedGCSlots && regMask == 0)
{
// No live GC refs in regs at the call -> don't record the call.
}

This optimization is conditioned on noTrackedGCSlots:

const bool noTrackedGCSlots =
(compiler->opts.MinOpts() && !compiler->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT) &&
!JitConfig.JitMinOptsTrackGCrefs());

Note that JitMinOptsTrackGCrefs is 0 for xarch but 1 everywhere else, so the optimization only kicks in for xarch:

#if defined(TARGET_AMD64) || defined(TARGET_X86)
#define JitMinOptsTrackGCrefs_Default 0 // Not tracking GC refs in MinOpts is new behavior
#else
#define JitMinOptsTrackGCrefs_Default 1
#endif
RELEASE_CONFIG_INTEGER(JitMinOptsTrackGCrefs, W("JitMinOptsTrackGCrefs"), JitMinOptsTrackGCrefs_Default)

From my measurements the optimization saves around 23% on GC info size reported by MinOpts contexts. As a downside it does not allow for the suspension on return addresses that @VSadov implemented recently. We should decide whether we want to enable it generally or not.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions