[lworld+fp16] RFR: 8333852: Allow flat array layout for value based classes.

Bhavana Kilambi bkilambi at openjdk.org
Wed Jul 3 11:54:32 UTC 2024


On Tue, 2 Jul 2024 11:50:39 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> Patch enables flat runtime layout for value based classes decorated with following annotations.
>   1. @NullRestrictedArray:  Newly added annotation, ensures flat array elements are never assigned a null value during the lifetime of array, a violation to this rule results into a NullPointerException.
>   2. @ImplicitylConstructible: Ensures default value assignment to flat array element at the time of new allocation.
>   3. @LooselyConsistentValue:  Relaxes strict atomic update constraint of value objects.
> 
> In addition, all primitive box classes when annotated with #1 and #2 assume atomic update since they wrap around primitive type fields.
> 
> With this patch, an array of Float16 type has flat runtime layout which enables auto-vectorization of FP16 operations.
> 
> Best Regards,
> Jatin

test/hotspot/jtreg/compiler/vectorization/TestFloat16VectorSum.java line 46:

> 44: 
> 45:     public static void main(String args[]) {
> 46:         TestFramework.runWithFlags("--enable-preview", "-XX:-TieredCompilation", "-Xbatch");

Hi Jatin, thanks for this patch. May I ask, why `-XX:-TieredCompilation` option is passed? It's one of the whitelisted flags and must be already applied when compiling the test isn't it?

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1154#discussion_r1664065690


More information about the valhalla-dev mailing list