[lworld] RFR: 8239003: [lworld] C2 should respect larval state when scalarizing [v2]

Jatin Bhateja jbhateja at openjdk.org
Thu Dec 21 06:46:17 UTC 2023


> Hi All,
> 
> Patch addresses the issue seen around unsafe updates to value objects within a loop.
> 
> 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:

  Minor modification in test case.

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/964/files
  - new: https://git.openjdk.org/valhalla/pull/964/files/76b47a18..32721ea2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=964&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=964&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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