RFR: 8327172: C2 SuperWord: data node in loop has no input in loop: replace assert with bailout

Emanuel Peter epeter at openjdk.org
Thu Mar 7 07:51:58 UTC 2024


On Tue, 5 Mar 2024 16:59:03 GMT, Christian Hagedorn <chagedorn 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.
>
> That looks reasonable. I agree to fix the ctrl issues separately and go with a bailout solution for now. Maybe you want to add a note at [JDK-8307982](https://bugs.openjdk.org/browse/JDK-8307982) to not forget about this case here.

Thanks @chhagedorn @vnkozlov for the reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/18123#issuecomment-1982793118


More information about the hotspot-compiler-dev mailing list