RFR: 8372779: C2: Disambiguate Node::adr_type for the IR graph [v2]
Quan Anh Mai
qamai at openjdk.org
Mon Dec 1 10:53:48 UTC 2025
> Hi,
>
> Currently, `Node::adr_type` is ambiguous. For some, it refers to the memory the node consumes, while for the others, it refer to the memory the node produces. This PR removes that ambiguity by introducing `Node::in_adr_type` and `Node::out_adr_type` that refer to those properties, respectively. It also introduces a local verification of the memory graph during compilation. These additions uncover some issues:
>
> - Sometimes, the memory is wired incorrectly, such as in `LibraryCall::extend_setCurrentThread`, the `Phi` collect the `StoreNode`s instead of the whole memory state. I think these issues do not result in crashes or miscompilation, though.
> - `AryEqNode` reports `adr_type` being `TypeAryPtr::BYTES` (it inherits this from `StrIntrinsicNode`). This is incorrect, however, as it can accept `char[]` inputs, too.
> - For nodes such as `StrInflatedCopyNode`, as it consumes more than it produces, during scheduling, we need to compute anti-dependencies. This is not the case, so I fixed it by making it kill all the memory it consumes.
> - `GraphKit::set_output_for_allocation` uses a raw `ProjNode` as the base for a `MergeMem`, this is really suspicious. I didn't fix it, as it seems to not result in any symptom at the moment.
>
> In the end, the execution of the compiler is strictly more restricted than before, and there is less room for ambiguity.
>
> Please take a look and leave your reviews, thanks a lot.
Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
store_to_memory does not emit MemBars
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28570/files
- new: https://git.openjdk.org/jdk/pull/28570/files/10c0303f..b39029a3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28570&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28570&range=00-01
Stats: 9 lines in 1 file changed: 4 ins; 2 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/28570.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28570/head:pull/28570
PR: https://git.openjdk.org/jdk/pull/28570
More information about the hotspot-dev
mailing list