RFR(XS): 8170470: superword may miss reductions

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Nov 29 18:04:07 UTC 2016


Nice find! Looks good.

Thanks,
Vladimir

On 11/29/16 5:14 AM, Roland Westrelin wrote:
>
> http://cr.openjdk.java.net/~roland/8170470/webrev.00/
>
> This was discussed before on aarch64-port-dev. With the following
> method:
>
>   public static int vectSumOfMulAdd1(
>           int[] a,
>           int[] b,
>           int[] c,
>           int[] d) {
>     int total = 0;
>     for (int i = 0; i < LENGTH; i++) {
>       d[i] = (int)(a[i] * b[i] + c[i]);
>       total += d[i];
>     }
>     return total;
>   }
>
> the main loop is not vectorized because the reduction is missed by the
> superword optimization. The result of the reduction is used by a control
> node (Return here) and the reduction is wrongly discarded.
>
> Roland.
>


More information about the hotspot-compiler-dev mailing list