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

Xiaohong Gong xgong at openjdk.org
Tue Jan 20 06:37:02 UTC 2026


On Fri, 16 Jan 2026 09:36:32 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/micro/org/openjdk/bench/vm/compiler/VectorAlgorithmsImpl.java line 61:
>> 
>>> 59:         }
>>> 60:         return r;
>>> 61:     }
>> 
>> You can add another flavor for vector API kernels where tail is implemented using masked operations.
>> 
>> 
>> if (i < r.length) {
>>     VectorMask<Integer> mask = SPECIES_I.indexInRange(i, r.length);
>>     v.intoArray(r, i, mask);
>> }
>> 
>> 
>> Simply replicated the loop body guarded by Mask.
>> https://github.com/openjdk/jdk/pull/28002/changes#diff-b5c49811dff21107eb8c8ab0578be4cd235c6f69bafd879a8e4b4620b974c25bR153-R159
>
> Good idea, I could!
> However, it would mean I would have to probably add this version for every benchmark.
> I'm wondering if that is worth it.
> I think I won't add it now, but maybe in a follow-up RFE :)

Creating a mask for each loop iteration may affect Vector API benchmark results, especially on SVE. If the benchmark is intended to compare Vector API performance against auto‑vectorization, using a tail‑loop version would be preferable for a more fair comparison.

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

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


More information about the hotspot-compiler-dev mailing list