JDK-8291669 : [REDO] Fix array range check hoisting for some scaled loop iv
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2022-08-02
  • Updated: 2023-09-12
  • Resolved: 2022-09-14
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 20
20 b08Fixed
Related Reports
Cloners :  
Sub Tasks
JDK-8291597 :  
Description
Recently we found that in some loops with scaled array accesses, array range checks are not hoisted by loop predication. A typical case is below.

 for (int i = 0; i < size; i++) {
     b[3 * i] = a[3 * i];
 }

Initial investigation found that GVN optimizes the array index "3 * i" into "i << 1 + i" so it's regarded as non-linear.
Comments
Changeset: 211fab8d Author: Pengfei Li <pli@openjdk.org> Date: 2022-09-14 14:20:39 +0000 URL: https://git.openjdk.org/jdk/commit/211fab8d361822bbd1a34a88626853bf4a029af5
14-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9851 Date: 2022-08-12 09:42:25 +0000
12-08-2022