-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
Description
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 prejitting16 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
mikedn, YuriiPovkh and briansull
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization