RFR: 8370914: C2: Reimplement Type::join [v4]
Quan Anh Mai
qamai at openjdk.org
Wed Jan 7 18:35:46 UTC 2026
On Wed, 7 Jan 2026 18:02:31 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> We probably need associativity, but then, if we have an abstract domain that is a lattice, that should be rather straightforward. If we start having simple posets instead, we can be very sound, but associativity might require more care...
>
> @marc-chevalier Thanks for your reviews. I have addressed and responded to your concerns.
> Thanks @merykitty. I do hope I am not misunderstanding. I would argue that in theory, empty is correct here and null is wrong, but in practice I don't think it matters except for dead code. Can you come up with an example where the difference matters?
C2 only remembers one Klass, so it makes sense to use LCA(Klass1,Klass2) for meet(Klass1,Klass) in the summarized result, even though it loses information.
Something that looks like this:
Object o;
Integer i = (Integer) o;
Float f = (Float) f;
// C2 may wrongly assume it is dead code here, the reason we do not encounter this is that `GraphKit::gen_checkcast` does the null path and the non-null path separately, so we end up with `Phi(null, non-null Float)` and since the `non-null Float` is dead it is left with `null`
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28051#issuecomment-3720195876
More information about the hotspot-compiler-dev
mailing list