KEMBAR78
Investigate impact of method entry alignment · Issue #9912 · dotnet/runtime · GitHub
Skip to content

Investigate impact of method entry alignment #9912

@AndyAyersMS

Description

@AndyAyersMS

Current code alignment strategy seems a bit random. Best I can tell it is:

  • on x86 we generally 8 byte align jitted code, but we 16 byte align small methods. When prejitting we 16 byte align IBC hot methods, and otherwise 4 byte align.
  • on x64 we always 8 byte align when jitting and 16 byte align when prejitting 16 byte align.

Haven't looked at arm32 / arm64.

Over-aligning leads to wasted code space; under-aligning leads to possible perf issues ,either poor per or just randomly variable perf, as in #9815.

Generally speaking we'd prefer frequently-called methods to be maximally aligned and rarely called methods be minimally aligned. From a jit standpoint it seems like minopts/debug/tier0 code should always have minimum alignment; tier1 code should have maximum alignment, and the alignment of regularly optimized code is open for discussion.

Also note method entry alignment constrains loop top alignment (#11607).

category:cq
theme:basic-cq
skill-level:expert
cost:large
impact:small

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions