RFR: 8327172: C2 SuperWord: data node in loop has no input in loop: replace assert with bailout
Vladimir Kozlov
kvn at openjdk.org
Tue Mar 5 18:55:46 UTC 2024
On Tue, 5 Mar 2024 14:53:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> This is a regression fix from https://github.com/openjdk/jdk/pull/17657.
>
> I had never encountered an example where a data node in the loop body did not have any input node in the loop.
> My assumption was that this should never happen, such a node should move out of the loop itself.
>
> I now encountered such an example. But I think it shows that there are cases where we compute the ctrl wrong.
>
> https://github.com/openjdk/jdk/blob/8835f786b8dc7db1ebff07bbb3dbb61a6c42f6c8/test/hotspot/jtreg/compiler/loopopts/superword/TestNoInputInLoop.java#L65-L73
>
> I now had a few options:
> 1. Revert to the code before https://github.com/openjdk/jdk/pull/17657: handle such cases with the extra `data_entry` logic. But this would just be extra complexity for patterns that shoud not exist in the first place.
> 2. Fix the computation of ctrl. But we know that there are many edge cases that are currently wrong, and I am working on verification and fixing these issues in https://github.com/openjdk/jdk/pull/16558. So I would rather fix those pre-existing issues separately.
> 3. Just create a silent bailout from vectorization, with `VStatus::make_failure`.
>
> I chose option 3, since it allows simple logic, and only prevents vectorization in cases that are already otherwise broken.
Looks good.
-------------
Marked as reviewed by kvn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18123#pullrequestreview-1917880586
More information about the hotspot-compiler-dev
mailing list