RFR: 8276673: Optimize abs operations in C2 compiler [v6]

Jie Fu jiefu at openjdk.java.net
Mon Dec 20 06:16:23 UTC 2021


On Mon, 20 Dec 2021 04:35:37 GMT, Fei Gao <fgao at openjdk.org> wrote:

> > I discussed this opt with @theRealAph offline.
> > To clarify from my point of view:
> > 
> > 1. I have no objection to this PR.
> > 2. I'd like to see a benchmark which people would write in real programs.
> > 3. But if the OpenJDK experts think it's already good enough, please go ahead.
> > 
> > Thanks.
> 
> Hi, @DamonFool
> 
> I ran the jtreg test internally with some logging info to verify if the optimization works in real java program. The results shows that these patterns are hit in the following cases:
> 
> • java/lang/StackWalker/LocalsAndOperands.java#id0 • java/lang/StackWalker/LocalsAndOperands.java#id1 • java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java • java/util/concurrent/tck/JSR166TestCase.java • javax/management/timer/MissingNotificationTest.java • jdk/incubator/vector/Double128VectorTests.java • jdk/incubator/vector/Double256VectorTests.java • jdk/incubator/vector/Double512VectorTests.java • jdk/incubator/vector/Double64VectorTests.java • jdk/incubator/vector/DoubleMaxVectorTests.java • jdk/incubator/vector/Float128VectorTests.java • jdk/incubator/vector/Float256VectorTests.java • jdk/incubator/vector/Float512VectorTests.java • jdk/incubator/vector/Float64VectorTests.java • jdk/incubator/vector/FloatMaxVectorTests.java • jdk/incubator/vector/Vector128ConversionTests.java • jdk/incubator/vector/Vector256ConversionTests.java • jdk/incubator/vector/Vector64ConversionTests.java#id0 • jdk/incubator/vector/VectorMaxConversionTests.ja
 va
> 
> It’s not easy to identify these patterns from original java code by our eyes. Since the added code lines are hit, the patterns must occur after many rounds of optimization. Definitely, it benefits all platforms, whether x86 or aarch64.
> 
> As for the current benchmark, it’s not to show the real performance gain but to illustrate that the opto benefits x86 as well in case you wonder. If you need a real java program, the case won’t be light-weight or straightforward. Maybe I can’t provide you with a satisfying micro benchmark.
> 
> Thanks.

Good news!

But can you show us an example with more detailed analysis which pattern is applied in the test? 
Thanks.

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

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


More information about the hotspot-compiler-dev mailing list