RFR: 8289943: Simplify some object allocation merges [v4]

Cesar Soares duke at openjdk.org
Mon Aug 29 19:02:37 UTC 2022


> Hi there, can I please get some feedback on this approach to simplify object allocation merges in order to promote Scalar Replacement of the objects involved in the merge?
> 
> The basic idea for this [approach was discussed in this thread](https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2022-April/055189.html) and it consists of: 
> 1) Identify Phi nodes that merge object allocations and replace them with a new IR node called ReducedAllocationMergeNode (RAM node).
> 2) Scalar Replace the incoming allocations to the RAM node.
> 3) Scalar Replace the RAM node itself.
> 
> There are a few conditions for doing the replacement of the Phi by a RAM node though - Although I plan to work on removing them in subsequent PRs:
> 
> - The only supported users of the original Phi are AddP->Load, SafePoints/Traps, DecodeN.
> 
> These are the critical parts of the implementation and I'd appreciate it very much if you could tell me if what I implemented isn't violating any C2 IR constraints:
> 
> - The way I identify/use the memory edges that will be used to find the last stored values to the merged object fields.
> - The way I check if there is an incoming Allocate node to the original Phi node.
> - The way I check if there is no store to the merged objects after they are merged.
> 
> Testing:
> - Windows/Linux/MAC fastdebug/release 
>   - hotspot_all
>   - tier1
>   - Renaissance
>   - dacapo
>   - new IR-based tests

Cesar Soares has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 33 commits:

 - Refactoring. Fixe a bug. Add comments.
 - Fix build
   
   Merge branch 'master' into allocation-merges
 - rever changes in TEST.groups
 - fix conflict
 - - Address PR feedback
   - Make reducing allocation merges part of iterative EA
   - Fix bugs
   - Add more tests
 - work
 - work
 - work
 - work
 - Lift requirement for all inputs to be Allocate.
   Fix bugs.
 - ... and 23 more: https://git.openjdk.org/jdk/compare/27af0144...30314766

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

Changes: https://git.openjdk.org/jdk/pull/9073/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9073&range=03
  Stats: 2191 lines in 22 files changed: 2046 ins; 32 del; 113 mod
  Patch: https://git.openjdk.org/jdk/pull/9073.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9073/head:pull/9073

PR: https://git.openjdk.org/jdk/pull/9073


More information about the hotspot-compiler-dev mailing list