RFR: 8327172: C2 SuperWord: data node in loop has no input in loop: replace assert with bailout
Emanuel Peter
epeter at openjdk.org
Tue Mar 5 16:48:58 UTC 2024
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.
-------------
Commit messages:
- the fix
- 8327172
Changes: https://git.openjdk.org/jdk/pull/18123/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18123&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8327172
Stats: 103 lines in 3 files changed: 100 ins; 1 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/18123.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18123/head:pull/18123
PR: https://git.openjdk.org/jdk/pull/18123
More information about the hotspot-compiler-dev
mailing list