RFR: 8257561: Some code is not vectorized after 8251925 and 8250607

Vladimir Kozlov kvn at openjdk.java.net
Thu Dec 3 20:10:56 UTC 2020


On Thu, 3 Dec 2020 19:43:33 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> Thank you @chhagedorn, @iwanowww, @TobiHartmann for reviews.
>
> FWIW I was playing around with a few naive micros like the following:
> 
>     private int[] values; // 500 random integers
> 
>     @Benchmark
>     public int multiplyFive() {
>         int x = 1;
>         for (int i : values) {
>             x += i * 5;
>         }
>         return x;
>     }
>  
> 
> and noticed this had gotten 3x slower in 16-b25 on my sandybridge workstation. The patch here recuperates the performance in the micro to levels in 16-b24
> 
> Perhaps a micro like that (simple arithmetic in a counted loops which apparently can be aggressively autovectorized) could be somewhat useful as a regression test?

Yes, it is simple reduction test (calculate sum) similar to compiler/loopopts/superword/ProdRed_Int.java

To use it as regression test we need to look with OutputAnalyzer on output of run with -XX:+TraceNewVectors.
The output should contain specific types of vectors. Does not matter how many of them, which may very due to different unrolling and vector max width (different AVX).
 
Can you @cl4es write it?

Thanks,
Vladimir

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

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


More information about the hotspot-compiler-dev mailing list