[lworld] RFR: 8257166: [lworld] CCP fails to optimize FlatArrayCheckNode

Tobias Hartmann thartmann at openjdk.java.net
Fri Nov 27 08:09:11 UTC 2020


We hit `assert(!t->is_flat() && !t->is_not_flat()) failed: Should have been optimized out` during macro expansion of a FlatArrayCheckNode because the input array is known to be not flat but the check hasn't been optimized out by IGVN. The problem is that when CCP processes the node via `FlatArrayCheckNode::Value` the type immediately goes from TOP to BOTTOM because the input array hasn't been processed yet (still has type TOP). Afterwards, the node is not processed anymore although the type could be improved once the input array has been processed and is now known to be not flat.

We should add verification code that catches such cases. I've filed [JDK-8257197](https://bugs.openjdk.java.net/browse/JDK-8257197) to do this in mainline. A quick prototype suggests that we have multiple similar issues in mainline code.

Thanks,
Tobias

-------------

Commit messages:
 - 8257166: [lworld] CCP fails to optimize FlatArrayCheckNode

Changes: https://git.openjdk.java.net/valhalla/pull/282/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=282&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257166
  Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/282.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/282/head:pull/282

PR: https://git.openjdk.java.net/valhalla/pull/282


More information about the valhalla-dev mailing list