FR[M]: 8151779: Some intrinsic flags could be replaced with one general flag
Corey Ashford
cjashfor at linux.ibm.com
Mon Apr 13 20:42:40 UTC 2020
On 4/13/20 10:33 AM, Liu, Xin wrote:
> Hi, compiler developers,
> I attempt to refactor UseXXXIntrinsics for JDK-8151779. I think we still need to keep UseXXXIntrinsics options because many applications may be using them.
>
> My change provide 2 new features:
> 1) a shorthand to enable/disable intrinsics.
> A comma-separated string. Each one is an intrinsic. An optional tailing symbol + or '-' denotes enabling or disabling.
> If the tailing symbol is missing, it means enable.
> Eg. -XX:UseIntrinsics="AESCTR-,CRC32C+,CRC32-,MathExact"
> This jvm option will expand to multiple options -XX:-UseAESCTRIntrinsics, -XX:+UseCRC32CIntrinsics, -XX:-UseCRC32Intrinsics, -XX:UseMathExactIntrinsics
>
> 2) provide a set of macro to declare intrinsic options
> Developers declare once in intrinsics.hpp and macros will take care all other places.
> Here are example: https://cr.openjdk.java.net/~xliu/8151779/00/webrev/src/hotspot/share/compiler/intrinsics.hpp.html
> Ion Lam is overhauling jvm options. I am thinking how to be consistent with his proposal.
>
Great idea, though to be consistent with the original syntax, I think
the +/- should be in front of the name:
-XX:UseIntrinsics=-AESCTR,+CRC32C,...
> I handle UseIntrinsics before VM_Version::initialize. It means that platform-specific initialization still has a chance to correct those options.
> If we do that after VM_Version::initialize, some intrinsics may cause JVM crash. Eg. +UseBase64Intrinsics on x86_64 Linux.
> Even though this behavior is same as -XX:+UseXXXIntrinsics, from user's perspective, it's not straightforward when JVM overrides what users specify implicitly. It's dilemma here, stable jvm or fidelity of cmdline. What do you think?
>
> Another problem is naming convention. Almost all intrinsics options use UseXXXIntrinsics. One exception is UseVectorizedMismatchIntrinsic.
> Personally, I think it should be "UseXXXIntrinsic" because one option is for one intrinsic, right? Is it possible to change this name convention?
Some (many?) intrinsic options turn on more than one .ad instruct
instrinsic, or library instrinsics at the same time. I think that's why
the plural is there. Also, consistently adding the plural allows you to
add more capabilities to a flag that initially only had one intrinsic
without changing the plurality (and thus backward compatibility).
Regards,
- Corey
More information about the hotspot-compiler-dev
mailing list