[lworld] RFR: 8239003: [lworld] C2 should respect larval state when scalarizing [v3]
Jatin Bhateja
jbhateja at openjdk.org
Fri Dec 22 06:45:29 UTC 2023
> Hi All,
>
> Patch addresses issues around unsafe updates to value objects within a loop and larval state preservation by suppressing
> scalarization of value objects in larval state.
>
> Since Unsafe.put* APIs returns a void, hence it does not alter JVM state. Due to this ciTypeFlow dataflow analysis does
> not encounter an inductive definition corresponding to updated value object within the loop, due to this C2 parser misses
> creating an inductive phi node on encountering loop header block.
>
> In order to maintain IR compliance with ciTypeFlow analysis C2 should prevent scalarizing value object b/w make and finish
> private buffer calls.
>
> New behavior of unsafe inline expanders
>
> * makePrivate: Receive InlineTypeNode input and return initialized buffer in larval state.
> * finishPrivateBuffer: Receive value object buffer input and return rematerialize InlineTypeNode in non-larval state.
> This may result into creation of unbalanced phi node at control flow merges where one of the phi input may InlineTypeNode
> and other is a buffer of compatible value type, but the IR still remains valid.
>
> In addition compiler is now preventing elimination of allocation in larval state.
>
> Validation Status:-
>
> All the Valhalla JTREG tests are passing at various AVX level with / wo -XX:+DoptimizeALot.
>
> Kindly review and share your feedback.
>
> Best Regards,
> Jatin
Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
Handling for passing larval state value objects across method calls.
-------------
Changes:
- all: https://git.openjdk.org/valhalla/pull/964/files
- new: https://git.openjdk.org/valhalla/pull/964/files/32721ea2..8eb0b01e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=valhalla&pr=964&range=02
- incr: https://webrevs.openjdk.org/?repo=valhalla&pr=964&range=01-02
Stats: 110 lines in 3 files changed: 106 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/valhalla/pull/964.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/964/head:pull/964
PR: https://git.openjdk.org/valhalla/pull/964
More information about the valhalla-dev
mailing list