[Arm64] Extend Compiler::lvaFrameAddress() and JIT to allow using SP as base register #47810
Labels
arch-arm64
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
optimization
Priority:2
Work that is important, but not critical for the release
Milestone
At the moment, on Arm64 we always establish frame pointer when allocating a stack frame. Given that fact and based on the logic in
Compiler::lvaFrameAddress()
the JIT would always usefp
as a base register for addressing locals and temps. This can lead to un-optimal codegen in a situation when the JIT is required to useframeType=5
(i.e., whenfp
points to a location above locals) instead offrameType=3
(i.e., whenfp
points to a location below locals). The following is a snippet of such un-optimal codegen when such restriction onfp
value is imposed:I noticed this while implementing stack probe helper support on Arm64 in #43250 when the JIT is required to store
fp,lr
register pair earlier during prolog execution to be able to call a helper.@dotnet/jit-contrib
category:cq
theme:register-allocator
The text was updated successfully, but these errors were encountered: