JDK-8149543 : range check CastII nodes should not be split through Phi
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-02-10
  • Updated: 2020-02-26
  • Resolved: 2016-02-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9 Other
7u241Fixed 8u102Fixed 9 b108Fixed openjdk7uFixed
Related Reports
Relates :  
Description
Reported by Michael Berg for vectorization optimizations.
In cases like this:

  public static float sumListReduction(float[] a, float[] b, float[] c, float[] d, float total, int process_len)
  {
    for(int i = 0; i < process_len; i++)
    {
      d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]);
    }

    total += d[0];
    total += d[process_len-1];
    return total;
  }

Range check CastII nodes are split through Phis which causes new Phis to be created that are unrelated to the trip Phi and prevent further optimization:

Phi 735    718 43 384 [ 784 384 ] bci = 10 debug_orig =  dump_spec = #int:>=1:www #tripcount debug_idx = 17200735 line = 32 type = int:

Phi 921    718 43 384 [ 727 ] bci = 16 debug_orig =  dump_spec = #int:1..max-1:www debug_idx = 23800921 line = 32 type = int:

ILW=M(prevent optimization)M(some code with loops)H(none)=P3
Comments
regarding lack of test case: change affects code generation which cannot be observed from a test case
15-02-2016

Should we backport this to 8? Because JDK-6675699 was backported to 8u82.
15-02-2016