RFR: 8341976: C2: use_mem_state != load->find_exact_control(load->in(0)) assert failure [v2]

Roland Westrelin roland at openjdk.org
Mon Mar 31 11:55:24 UTC 2025


On Mon, 31 Mar 2025 10:46:50 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> It doesn't look an actual issue to me. `PhiNode::Value` manages to narrow the trip `phi`'s type of the pre loop enough that it's a constant. So the loop no longer has the expected counted loop shape but the loop exit condition that should constant fold doesn't because it's guarded by an `Opaque1` node.
>
> This sounds very similar to [JDK-8297752](https://bugs.openjdk.org/browse/JDK-8297752) which also caused problems outside of `TraceLoopOpts`. We should probably handle this separately from this PR.

Right. So maybe, we could treat that `Opaque` node the way we do for `OpaqueZeroTripGuard` and have it constant fold when the backedge is never taken.

So I should revert the change to the `IdealLoopTree::dump_head()` and the test run with `TraceLoopOpts`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23465#discussion_r2020899830


More information about the hotspot-compiler-dev mailing list