RFR: 8314612: TestUnorderedReduction.java fails with -XX:MaxVectorSize=32 and -XX:+AlignVector [v3]

Christian Hagedorn chagedorn at openjdk.org
Tue Sep 12 13:38:40 UTC 2023


On Tue, 12 Sep 2023 12:28:04 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> **Problem**
>> 
>> There is a case where `PhaseIdealLoop::move_unordered_reduction_out_of_loop` gets a chain of `UnorderedReduction` which have differing vector lengths. But this can lead to wrong results, as some elements now get dropped or "hallucinated".
>> 
>> Details:
>> `-XX:+AlingVector` creates alignment boundaries over which no pack can go. Effectively, it cuts the packs at the alignment boundaries. This can create unexpected series of packs with lengths `[4, 8, 4]`, rather than `[8, 8]`.
>> 
>> **Solution**
>> 
>> We need to check that all `UnorderedReduction` have the same `vect_type()`. That ensures all have the same length and element type.
>> 
>> **Testing**
>> 
>> I converted the old test into scenario `v016-U`, and added scenario `v032-A` (fails without the patch). Also, I added some vanilla scenarios, just to ensure the test cases can be run with other flag combinations. The IR tests are targeted at scenario `v016-U`.
>> 
>> Tests: tier1-6, stress-testing. **Running**
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add c2 requires

Marked as reviewed by chagedorn (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/15654#pullrequestreview-1622277039


More information about the hotspot-compiler-dev mailing list