RFR: 8327661: C1: Make RBP allocatable on x64 when PreserveFramePointer is disabled

Dean Long dlong at openjdk.org
Mon Mar 11 19:22:12 UTC 2024


On Fri, 8 Mar 2024 11:12:53 GMT, Denghui Dong <ddong at openjdk.org> wrote:

> Hi,
> 
> Could I have a review of this change that makes RBP allocatable in c1 register allocation when PreserveFramePointer is not enabled.
> 
> There seems no reason that RBP cannot be used. Although the performance of c1 jit code is not very critical, in my opinion, this change will not add overhead of compilation. So maybe it is acceptable.
> 
> I am not very sure if I have changed all the places that should be.
> 
> Performance:
> 
> I wrote a simple JMH included in this patch.
> 
> On Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
> 
> Before this change:
> 
> 
> Benchmark                                                     Mode  Cnt   Score   Error  Units
> C1PreserveFramePointer.WithPreserveFramePointer.calculate     avgt   16  15.270 ± 0.011  ns/op
> C1PreserveFramePointer.WithoutPreserveFramePointer.calculate  avgt   16  14.479 ± 0.012  ns/op
> 
> 
> After this change:
> 
> 
> Benchmark                                                     Mode  Cnt   Score   Error  Units
> C1PreserveFramePointer.WithPreserveFramePointer.calculate     avgt   16  15.264 ± 0.006  ns/op
> C1PreserveFramePointer.WithoutPreserveFramePointer.calculate  avgt   16  14.057 ± 0.005  ns/op
> 
> 
> 
> Testing: fastdebug tier1-4 on Linux x64

src/hotspot/cpu/x86/c1_Defs_x86.hpp line 47:

> 45: 
> 46: #ifdef _LP64
> 47:   #define UNALLOCATED 3    // rsp, r15, r10

This affects pd_nof_caller_save_cpu_regs_frame_map below, but RBP is callee-saved, not caller-saved.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18167#discussion_r1520305676


More information about the hotspot-compiler-dev mailing list