FR[M]: 8151779: Some intrinsic flags could be replaced with one general flag
Liu, Xin
xxinliu at amazon.com
Mon Apr 13 17:33:54 UTC 2020
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.
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?
I plan to write a gtest to test intrinsics.cpp and finalize the webrev when Ion finalize his overhaul.
But here is quick preview of my change. I really appreciate if you can give me some feedback.
https://cr.openjdk.java.net/~xliu/8151779/00/webrev/
I use -XX:+PrintFlagsFinal to verify my expression work or not. eg.
$java -XX:UseIntrinsics=",AESCTR-,CRC32C,,CRC32-,,MathExact," -XX:+PrintFlagsFinal -version |& grep "Use.*Intrinsics"
Thanks.
--lx
More information about the hotspot-compiler-dev
mailing list