RFR: 8231754: [JVMCI] Make r27 unconditionally reserved in JVMCI

Gilles Duboscq gilles.m.duboscq at oracle.com
Fri Oct 11 08:47:02 UTC 2019


Hi Andrew,

By "other compilers" i meant C1 and C2. Neither of those compilers ever allocates r27.
If they would they would likely also run into issue like Graal did when we tried to follow what JVMCI says before this fix (i.e., "r27 can be allocated if compressed oops are disabled").
For context, Graal currently avoids r27 regardless of what JVMCI says.

To me it looks like the aarch64 port just does not support allocating r27 in its current state and we want to make JVMCI reflect that.

Out of curiosity we tried to see what is currently preventing r27 from being allocated and the issue that Yudi described is a problem we spotted.
That does not mean there are no other issues. Determining that would require a much more careful review of the code and testing (for example by making is alloctable by C1, C2, and Graal and running extensive test suites).

Regards,
  Gilles

On 11/10/2019 10:27, Andrew Dinn wrote:
>> On 11/10/2019 07:47, dean.long at oracle.com wrote:
>>> Wouldn't it be better to make r27 callee-saved in
>>> cpu/aarch64/sharedRuntime_aarch64.cpp:RegisterSaver::save_live_registers()?
> 
> On 11/10/2019 08:55, Gilles Duboscq wrote:
>> The idea was to first bring JVMCI in line with what the other compilers
>> do (never allocate r27) and then investigate how we could make r27
>> conditionally allocatable if there is interest.
> 
> I prefer Dean's suggestion. If I understand this patch correctly it
> seems it was motivated by a desire to deal with the failure to mark r27
> as callee-saved in save_live_registers when it has been made
> allocatable. Bypassing that bug by disabling the optimization seems to
> me to be a needless regression; why not just fix the bug? (also, see below).
> 
> n.b. I guess that also answers your speculation as to whether anyone is
> interested in allocating conditionally -- we were interested enough some
> time ago to implement this.
> 
> When you say 'other compilers' are you referring to the Graal JIT? Or is
> there also a problem with C1 and/or C2? (or maybe some other JVMCI
> compiler we don't yet know about? ;-).
> 
> If the problem is just that Graal cannot work safely when r27 is
> allocatable then can we not change the condition for enabling use of r27
> to include a test that JVMCI is disabled? (and fix the callee_saved
> issue at the same time, of course :).
> 
> regards,
> 
> 
> Andrew Dinn
> -----------
> Senior Principal Software Engineer
> Red Hat UK Ltd
> Registered in England and Wales under Company Registration No. 03798903
> Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
> 


More information about the hotspot-compiler-dev mailing list