RFR: 8318446: C2: optimize stores into primitive arrays by combining values into larger store [v6]
Emanuel Peter
epeter at openjdk.org
Thu Mar 7 07:47:57 UTC 2024
On Tue, 30 Jan 2024 14:43:41 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> @shipilev
>> You are right, I need to guard the optimization with `UseUnalignedAccesses`. Just added it. Thanks you 😊
>> Probably my tests would have run into the `SIGBUS` you mentioned.
>>
>> About `InitializeNode::coalesce_subword_stores`:
>> It only works on raw-stores, which write fields before the initialization of an object. It only works with constants.
>> Hence, the pattern is quite different.
>> Merging the two would be a lot of work. Too much for me for now.
>> But maybe one day we can cover all these cases in a single optimization, that merges/coalesces all sorts of loads and stores, and essencially vectorizes any straingt-line code, at least for loads and stores.
>> For now, I just wanted to add the feature that @cl4es and @RogerRiggs were specifically asking for, which is merging array stores for constants and variables (using shift to split).
>>
>> @rwestrel
>> Ok. Well in that case I might have to make a more intelligent pointer-analysis, and parse past `ConvI2L` and `CastII` nodes.
>
>> Ok. Well in that case I might have to make a more intelligent pointer-analysis, and parse past ConvI2L and CastII nodes.
>
> Do you still need a traversal of the graph to find the Stores or can you enqueue them for post loop opts then?
@rwestrel
> Do you intend to add an IR test case?
I already have IR tests that also do result verification:
`test/hotspot/jtreg/compiler/c2/TestMergeStores.java`
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16245#issuecomment-1982785244
More information about the hotspot-compiler-dev
mailing list