Ensure Arm64 method local constants don't live next to the code #71155
Labels
arch-arm64
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
As per #71044 (comment), we currently have "method local constants" emitted as part of the method body block on Arm64. This is unlike x64 where we allocate a distinct area separate from the method.
We do this to ensure that these constants can be cheaply accessed via
ldr
. However, much like on x86/x64, placing "data" in the same page as your "code" can be problematic as it can negatively impact the instruction decoder, instruction cache, lead to poor speculative execution, etc.We should look at a better approach to handling this to ensure that this data can be placed in a distinct page from the code. One recommendation was to create an "anchor" to the data section and then offset from that anchor to access the constants. It can be assumed that re-materializing the constant is "cheap" to avoid spilling.
category:implementation
theme:memory-usage
The text was updated successfully, but these errors were encountered: