Integrated: 8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller

Joshua Zhu jzhu at openjdk.java.net
Thu Sep 24 00:57:59 UTC 2020


On Fri, 11 Sep 2020 12:23:30 GMT, Joshua Zhu <jzhu at openjdk.org> wrote:

> I noticed all Floating-Point and SIMD Registers are defined as SOC
> registers in c calling convention on AArch64.
> As AArch64 ABI tells, the bottom 64 bits of v8-v15 are callee-saved.
> 
> When using CallRuntime, with the help of existing flag "exclude_soe" and
> function add_call_kills(), SOE registers are killed by the call
> because values that could show up in the RegisterMap aren't live in
> callee saved registers.
> But CallLeaf and CallLeafNoFP are ok because they don't have safepoint
> and debug info.
> 
> Therefore I submit this patch that aligns save-policy in c calling
> convention with AArch64 ABI. It could help eliminate unnecessary SOE
> registers spilling in caller across CallLeafNode.
> 
> I wrote a simple test case:
>   http://cr.openjdk.java.net/~jzhu/8253048/Test.java
> Original OptoAssembly is:
>   http://cr.openjdk.java.net/~jzhu/8253048/old_OptoAssembly
> With the patch, unnecessary spillings are eliminated:
>   http://cr.openjdk.java.net/~jzhu/8253048/new_OptoAssembly
> 
> And when a vector is alive across CallLeaf, with the help of existing
> FatProjectionNode and RA, the whole vector register ( length > 64-bit )
> is still spilled to stack as usual.
> 
> A test case using VectorAPI is written to verify:
>   http://cr.openjdk.java.net/~jzhu/8253048/TestVector.java
> Test patch:
>   http://cr.openjdk.java.net/~jzhu/8253048/patch
> OptoAssembly dump:
>   http://cr.openjdk.java.net/~jzhu/8253048/TestVector_OptoAssembly
> 
> I also searched all occurrences of "V8-V15" in aarch64 codes.
> The stubs for sin/cos don't save v10 before usage.
> Therefore I replace it with caller-save register v24.
> 
> Jtreg Testing: hotspot_all_no_apps, jdk_core and langtools:tier1
> 
> Could you please help review this change?
> 
> Best Regards,
> Joshua
> 
> ---------

This pull request has now been integrated.

Changeset: ba174af3
Author:    Joshua Zhu <jzhu at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/ba174af3
Stats:     22 lines in 2 files changed: 0 ins; 0 del; 22 mod

8253048: AArch64: When CallLeaf, no need to preserve callee-saved registers in caller

Reviewed-by: adinn, aph

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

PR: https://git.openjdk.java.net/jdk/pull/129


More information about the hotspot-dev mailing list