RFR(S): 8198987: [Graal] compiler/intrinsics/sha/sanity tests fail on macos with Graal as JIT
stewartd.qdt at qualcommdatacenter.com
Thu Apr 5 14:50:02 UTC 2018
This patch actually causes a failure in TestSHA512MultiBlockIntrinsics.java. The issue is that the patch now appears to cause the various SHA classes to be loaded due to the function isIntrinsicsAvailable(), which causes a class load with the getDeclaredMethod() call. Before, the classes never actually got loaded, just (essentially) the flags checked. Now, the classes are loaded during the check.
This affects the behavior of LibraryCallKit::inline_digestBase_implCompressMB_predicate() in src/hotspot/share/opto/library_call.cpp. In that file, there is a check of whether the classes are loaded or not. It appears to make its decision on whether to use intrinsics based on whether the class is loaded or not.
So now the SHA1 & SHA2 intrinsics are used (UseSHA1Intrinsic is True by default), whereas before they were not. So the check against SHASanityTestBase.MB_INTRINSIC_ID fails because the Intrinsic _digestBase_implCompressMB is actually in the log.
I'm not sure where the best fix for this is at, but wanted to bring this up as an issue.
I have created a bug at https://bugs.openjdk.java.net/browse/JDK-8201182
From: hotspot-compiler-dev [mailto:hotspot-compiler-dev-bounces at openjdk.java.net] On Behalf Of Tobias Hartmann
Sent: Monday, March 5, 2018 1:23 PM
To: Vladimir Kozlov <vladimir.kozlov at oracle.com>; hotspot-compiler-dev at openjdk.java.net
Subject: Re:  RFR(S): 8198987: [Graal] compiler/intrinsics/sha/sanity tests fail on macos with Graal as JIT
On 05.03.2018 18:05, Vladimir Kozlov wrote:
> On 3/5/18 6:31 AM, Tobias Hartmann wrote:
>> please review the following patch:
>> Although Graal supports SHA intrinsics , the test uses
>> LogCompilation to determine if the intrinsics were emitted which is
>> not supported by Graal. Also, the test does not check if the SHA
>> intrinsics are actually available. It also fails if C2 is used and the intrinsics are disabled via -XX:DisableIntrinsic=_sha_implCompress,_sha2_implCompress,_sha5_implCompress.
>> Similar to the mathexact tests (see JDK-8182727), we should use the
>> isIntrinsicAvailable WhiteBox API method. It currently always returns
>> false for Graal as JIT (Graal has its own unit tests for intrinsics).
More information about the hotspot-compiler-dev