[lworld] RFR: 8251442: [lworld] C2 compilation fails with assert(value->bottom_type()->higher_equal(_type)) [v2]

Tobias Hartmann thartmann at openjdk.java.net
Tue Aug 18 15:13:50 UTC 2020

> Similar to JDK-8242453 [1], the problem is that a load from a non-flat array can be pushed through an arraycopy from a
> flat array (see LoadNode::can_see_arraycopy_value) and end up with an inconsistent memory input (oop load from a flat
> array). The checks emitted by the arraycopy intrinsic will catch this and the load will be removed but other Ideal
> transformations can still be executed before that happens and encounter this inconsistent state.  The fix is to add
> CheckCastPPNodes to the arraycopy intrinsic that propagate the information that the src/dst array is not flat. This
> makes sure that the data path consistently dies if the input array is in fact a flat array. I've also removed the
> workaround from the JDK-8242453 [1] fix.  When updating the type of CheckCastPPNodes, we need to make sure that the
> not_null_free and not_flat properties of TypeAryPtr are propagated. This is done by TypeAryPtr::update_properties. A
> CheckCastPPNode that ends up with an inconsistent input is then simply replaced by TOP.  This change also includes:
> - Optimize subtype checks based on not_null_free/not_flat properties of array types
> - New tests to verify that checkcasts are folded if one array type is known to be not null-free/flat and the other type
>   is null-free/flat
> - Test suite should detect compilation bailouts and fail (currently, only completely missing compilations were detected)
> - Renamed "flat_array" to "flatten_array" (which means "flattened in arrays") for consistency with runtime code. We
>   should think about a better name.
> - Lots of refactoring, removal of default arguments in calls and dead code
> [1] https://bugs.openjdk.java.net/browse/JDK-8242453

Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:

  Removed too strong assert from InlineTypeBaseNode::merge_with


  - all: https://git.openjdk.java.net/valhalla/pull/151/files
  - new: https://git.openjdk.java.net/valhalla/pull/151/files/2a54ae89..2699610d

 - full: https://webrevs.openjdk.java.net/valhalla/151/webrev.01
 - incr: https://webrevs.openjdk.java.net/valhalla/151/webrev.00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/151.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/151/head:pull/151

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

More information about the valhalla-dev mailing list