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.
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.
- clones
-
JDK-8289996 Fix array range check hoisting for some scaled loop iv
- Closed