8230015: [instruction selector] generic vector operands support.
Yang Zhang (Arm Technology China)
Yang.Zhang at arm.com
Wed Aug 28 09:18:45 UTC 2019
The question how to reduce code size is discussed previously. I also create a JBS to track it under panama project. https://bugs.openjdk.java.net/browse/JDK-8229866
There is a more aggressive idea.
Using the idea of generic vector operands, I implement an example (vaddB/S/I) in AArch64 platform. The code size reduction in libjvm.so is ~30kb. If all the vector instructions are merged, the estimated size reduction will be ~300kb.
How about using a more aggressive way to reduce code size?
PS. When I test this patch in AArch64 platform, build fails with the log
undefined reference to `Matcher::do_post_selection_processing(Compile*, Node*)'.
I fix this failure by adding #ifdef X86 to these code.
From: hotspot-compiler-dev <hotspot-compiler-dev-bounces at openjdk.java.net> On Behalf Of Bhateja, Jatin
Sent: Thursday, August 22, 2019 2:50 PM
To: hotspot-compiler-dev at openjdk.java.net
Cc: Vladimir Kozlov <vladimir.kozlov at oracle.com>
Subject: 8230015: [instruction selector] generic vector operands support.
Please find below a patch for generic vector operands support during instruction selection.
Motivation behind the patch is to reduce the number of vector selection patterns whose operands meagerly differ in vector lengths.
This will not only result in lesser code being generated by ADLC which effectively translates to size reduction in libjvm.so but also help in better maintenance of AD files.
Using generic operands we were able to collapse multiple vector patterns over mainline
Initial number of vector instruction patterns (vec[XYZSD] + legVec[ZXYSD] : 510
Reduced vector instruction patterns (vecG + legVecG) : 222
With this we could see around 1MB size reduction in libjvm.so.
In order to have minimal impact over downstream compiler passes, a post-selection pass has been introduced (currently enabled only for X86 target) which replaces these generic operands with their corresponding concreter vector length variants.
JBS : https://bugs.openjdk.java.net/browse/JDK-8230015
Patch : http://cr.openjdk.java.net/~jbhateja/genericVectorOperands/webrev.00/
Kindly review and share your feedback.
More information about the hotspot-compiler-dev