RFR: 8291809: Convert compiler/c2/cr7200264/TestSSE2IntVect.java to IR verification test [v2]

Daniel Lundén dlunden at openjdk.org
Thu Jan 25 15:32:36 UTC 2024


On Thu, 25 Jan 2024 14:30:41 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>>> @dlunde do you understand what factors determine the length of the vector? Why is the default of IRNode.VECTOR_SIZE_MAX not working?
>> 
>> Perhaps C2 hits the loop unrolling limit? @dlunde you can test this by trying out a large value for `-XX:LoopUnrollLimit`. But even if this turned out to be the case, I would still suggest using `IRNode.VECTOR_SIZE_ANY` rather than forcing a higher loop unroll limit value for the tests.
>
> Ah, I see what is the issue here: the loop does not just contain `int` vectors but also `long` vectors.
> Specifically, I see a `VectorCastI2X` and `VectorCastL2X` nodes in the loop, which converst `int` to/from `long`.
> Hence, if you have a `32 byte` vector, you can only have `4 long`, and so the loop-unrolling is limited to 4x.
> And then you only see `4 int` vectors, when you were expecting `8 int` vectors.
> 
> You will probably be able to fix the issue with this:
> `IRNode.VECTOR_SIZE + "min(max_int, max_long)"`
> 
> For more examples, check out:
> `grep "IRNode.VECTOR_SIZE +" test/hotspot/jtreg/ -r`

@eme64: Thanks, I'll check that `IRNode.VECTOR_SIZE + "min(max_int, max_long)"` works and use that.

@robcasloz: Thanks for the good idea; it indeed had to do with an unrolling limit. Just to clarify regarding `IRNode.VECTOR_SIZE_ANY` (after discussions with @eme64): I also thought `IRNode.VECTOR_SIZE_ANY` seemed like a good solution, but learned that `IRNode.VECTOR_SIZE_MAX` is the default because less than max vectorization usually indicates a problem. I may be wrong, but I believe `IRNode.VECTOR_SIZE_MAX` also varies depending on the platform. Therefore, I'll go with what Emanuel suggests for the `test_divc` and `test_divc_n` IR checks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1466545244


More information about the hotspot-compiler-dev mailing list