[lworld] RFR: 8361250: [lworld] use more IRNode regexes in valhalla IR tests
Tobias Hartmann
thartmann at openjdk.org
Mon Jul 7 09:03:07 UTC 2025
On Fri, 4 Jul 2025 16:36:36 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
> InlineTypeIRNode is Valhalla-specific and somewhat... antique. I've run into an issue where the old-timey regex for allocation didn't do the job. So, rather than reproducing the fix of [JDK-8314999](https://bugs.openjdk.org/browse/JDK-8314999) again, let's simply use `IRNode`'s regex for Valhalla as well.
>
> The general idea: let's not define node regex specifically for Valhalla, but only for values. I've also introduced regexes for combinations we do all the time: for instance rather than having `ALLOC_OF, ANY_KLASS`, I made a `ALLOC_OF_ANY_KLASS`.
>
> So what now:
> - `InlineTypeRegexes` => only value regexes.
> - `IRNode` => adapted to allow to define specialisation for `ALLOC_OF`, `ALLOC_ARRAY_OF`, `LOAD_OF_CLASS`, `STORE_OF_CLASS`, `STATIC_CALL_OF_METHOD` for specific classes/functions.
> - `InlineTypeIRNode` => define specialisations using the regexes defined in `InlineTypeRegexes`, nothing more!
> - `compiler/valhalla/inlinetypes/Test*` => use `IRNode` and `InlineTypeIRNode`.
This is a very nice cleanup. Thanks for working on this, Marc! Looks good, just a few comments.
test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java line 931:
> 929: }
> 930:
> 931: public static void anyLoadOfNodes(String irNodePlaceholder, String loadee) {
Should `loadee` be `holder` or `fieldHolder`?
test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java line 1950:
> 1948: }
> 1949:
> 1950: public static void anyStoreOfNodes(String irNodePlaceholder, String storee) {
Should `storee` be `holder` or `fieldHolder`? Same below.
test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java line 2918:
> 2916:
> 2917: private static void nonFlatStoreOfNodes(String irNodePlaceholder, String irNodeRegex, String storee) {
> 2918: String regex = START + irNodeRegex + MID + "@((stable:)?\\w+/)*" + storee + STORE_OF_CLASS_POSTFIX;
The only difference to `storeOfNodes` seems to be the `stable:` part but that is not specific to flat stores, right?
-------------
Marked as reviewed by thartmann (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/1503#pullrequestreview-2992840207
PR Review Comment: https://git.openjdk.org/valhalla/pull/1503#discussion_r2189419868
PR Review Comment: https://git.openjdk.org/valhalla/pull/1503#discussion_r2189420985
PR Review Comment: https://git.openjdk.org/valhalla/pull/1503#discussion_r2189425709
More information about the valhalla-dev
mailing list