On Mon, 18 May 2026 13:48:38 GMT, Roland Westrelin <[email protected]> wrote:
>>> Do we need both C2_CONTROL_DEPENDENT_LOAD and `C2_UNKNOWN_CONTROL_LOAD here? >> >> I took this from `ArrayCopyNode::load` where we have both as well (I think >> you did that with JDK-8323274 :slightly_smiling_face: ). We also have both >> in a few other places, for example in the `needs_range_check` branch in >> `Parse::array_load` (added with JDK-8333889). >> >>> Also, if the value is known null free and non atomic at compile time (the >>> runtime checks control fold and the loads are control dependent on the >>> range check), wouldn't we want to not pin the load? >> >> You mean if the array layout is known at compile time and the load is >> directly below the the range check? Yes, I think in that case we would want >> to not pin the load. Seems a bit risky / non-trivial though. Are you fine >> with deferring to a follow-up enhancement? > >> > Do we need both C2_CONTROL_DEPENDENT_LOAD and `C2_UNKNOWN_CONTROL_LOAD >> > here? >> >> I took this from `ArrayCopyNode::load` where we have both as well (I think >> you did that with JDK-8323274 🙂 ). We also have both in a few other places, >> for example in the `needs_range_check` branch in `Parse::array_load` (added >> with JDK-8333889). > > Right. We need both because the first one causes the control to be set and > the second to set the dependency type. > >> > Also, if the value is known null free and non atomic at compile time (the >> > runtime checks control fold and the loads are control dependent on the >> > range check), wouldn't we want to not pin the load? >> >> You mean if the array layout is known at compile time and the load is >> directly below the the range check? Yes, I think in that case we would want >> to not pin the load. Seems a bit risky / non-trivial though. Are you fine >> with deferring to a follow-up enhancement? > > Sure. Thanks Roland, I filed [JDK-8384865](https://bugs.openjdk.org/browse/JDK-8384865) for this. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2445#discussion_r3259441024
