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

Vladimir Kozlov kvn at openjdk.org
Mon Sep 11 18:35:39 UTC 2023


On Mon, 11 Sep 2023 09:17:46 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**

test/hotspot/jtreg/compiler/loopopts/superword/TestUnorderedReduction.java line 77:

> 75:             case "vanilla-A" -> { framework.addFlags("-XX:+AlignVector"); }
> 76:             case "v016-U"    -> { framework.addFlags("-XX:MaxVectorSize=16"); }
> 77:             case "v032-A"    -> { framework.addFlags("-XX:MaxVectorSize=32", "-XX:+AlignVector"); }

Is it possible to use full words here and in tests ids? `v016-U` -> `VectorSize16-Unaligned`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15654#discussion_r1321922745


More information about the hotspot-compiler-dev mailing list