RFR: 8323582: C2 SuperWord AlignVector: misaligned vector memory access with unaligned native memory [v4]

Emanuel Peter epeter at openjdk.org
Wed Feb 26 10:02:09 UTC 2025


On Wed, 26 Feb 2025 09:12:46 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Would it be possible and make sense to remove useless slow path loops the way it's done for predicates or zero trip guards? In `PhaseIdealLoop::build_loop_late_post_work()`, collect all `OpaqueMultiversioningNode` in a list. Then iterate over all loops the way it's done in `PhaseIdealLoop::eliminate_useless_zero_trip_guard()`, find loops marked as multi version, check we can get from the loop to the `OpaqueMultiversioningNode` and mark that one as useful. Eliminate all `OpaqueMultiversioningNode` not marked as useful. That way if some transformation such as peeling makes the loop non multi version or if the expected shape breaks for some reason, the slow loop is eliminated on next loop opts pass.

I suppose we could try that. Is it ok to do that in a separate RFE, so we are keeping this here to a more manageable size?

And would we not have similar issues with traversing from the loops to their `OpaqueMultiversioningNode`? What if some are not reachable in the meantime? Then we would just lose the `multiversion_if` early, and could not use it any more. So maybe we'd have to do that after the verification:
[JDK-8350637](https://bugs.openjdk.org/browse/JDK-8350637): C2: verify that main_loop finds pre_loop and that multiversion loops find the multiversion_if

I wonder if we do not have similar issues with `PhaseIdealLoop::eliminate_useless_zero_trip_guard()` currently. Maybe it's rare enough we don't notice.

@rwestrel What do you think?

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

PR Comment: https://git.openjdk.org/jdk/pull/22016#issuecomment-2684482233


More information about the hotspot-dev mailing list