RFR: 8373026: C2 SuperWord and Vector API: vector algorithms test and benchmark [v4]

Emanuel Peter epeter at openjdk.org
Fri Jan 16 08:09:05 UTC 2026


On Thu, 15 Jan 2026 18:08:27 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add dotProductF
>
> test/hotspot/jtreg/compiler/vectorization/TestVectorAlgorithms.java line 218:
> 
>> 216: 
>> 217:             // X4 oop setup.
>> 218:             oopsX4 = new int[size];
> 
> Any particular reason to keep input data initialization duplicated between test and benchmark modes?

Yes. Because they are not exactly the same. One is designed to test the implementation, the other to deliver reasonably stable and meaningful benchmarks.

Example of some differences:
- In the "test" environment, I have access to test libraries like `Generators.java`, which are better at generating edge-cases than regular `Random`.
- In the benchmark, the size is a fixed parameter `SEED`. In the test, it is a randomly chosen value, so we can test better for alignment/drain/post loops.
- `eI` can be chosen randomly in each iteration of the test. But for the benchmark it is better if we have an array of values to chose from, so that we can pick different values for each benchmark invocation.

But there is still a lot of overlap. I could try to split it into a "shared" and "local" part, and stuff the "shared" part into `VectorAlgorithmsImpl.Data`. @iwanowww Do you think that is worth it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28639#discussion_r2697409014


More information about the hotspot-compiler-dev mailing list