RFR: 8359602: Ideal optimizations depending on input type are missed because of missing notification mechanism from CCP [v2]

Benoît Maillard bmaillard at openjdk.org
Tue Jul 1 07:11:42 UTC 2025


On Mon, 30 Jun 2025 13:52:01 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> @benoitmaillard Very nice work, and great description :)

Thank you!

> > Did you check if this allows enabling any of the other disabled verifications from [JDK-8347273](https://bugs.openjdk.org/browse/JDK-8347273)?
> 
> That may be a lot of work. Not sure if it is worth checking all of them now. @TobiHartmann how much should he invest in this now? An alternative is just tackling all the other cases later. What do you think?

I have started to take a look at this and it seems that there are a lot of cases to check indeed.

> @benoitmaillard One more open question for me: `raise_bottom_type` only sets the node internal `_type`. But in IGVN, we do not read from `_type` but `phase->type(in(2))`. Do you know when the `phase->type(in(2))` value changes? Is that also during CCP? Before or after the `_type` is modified?

Yes, good point, I should I have mentioned this somewhere. The `phase->type(in(2))` call uses the type array from `PhaseValues`. The type array entry is actually modified earlier, in `PhaseCCP::analyze`, right after the `Value` call. You can see the `set_type` call [here](https://github.com/benoitmaillard/jdk/blob/75de51dff6d9cc3e9764737b29b9358992b488b7/src/hotspot/share/opto/phaseX.cpp#L2765). When this happens, users are added to the (local) worklist but again it does not change our issue as only value optimizations occur in that context.

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

PR Comment: https://git.openjdk.org/jdk/pull/26017#issuecomment-3022192988


More information about the hotspot-compiler-dev mailing list