RFR(XS): 8170470: superword may miss reductions

Roland Westrelin rwestrel at redhat.com
Tue Nov 29 13:14:08 UTC 2016


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