RFR: 8371716: C2: Phi node fails Value()'s verification when speculative types clash [v2]
Emanuel Peter
epeter at openjdk.org
Wed Nov 19 10:59:42 UTC 2025
On Wed, 19 Nov 2025 10:31:53 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix bug number
>
> src/hotspot/share/opto/cfgnode.cpp line 1360:
>
>> 1358: // same (union of input types), but the new `_type` has now no speculative type, the result of `t->filter_speculative(_type)`
>> 1359: // has the speculative type of `t` (if it's not removed because e.g. the resulting type is exact and non null) and not empty
>> 1360: // (like the previously returned type). In such a case, doing the filtering one time more allows to reach a fixpoint.
>
>> From that `ft` has empty speculative type
>
> I'm not very familiar with speculative types. Does "empty speculative" == TOP speculative type? Or rather "no speculative type", which essencially means it is BOTTOM type?
>
> Because then if we filter x with TOP we should still get TOP, but if we filter with BOTTOM we get x. And that would fit better with your statement later on:
>
>> but the new `_type` has now no speculative type, the result of `t->filter_speculative(_type)` has the speculative type of `t`
>
> Can you clarify please for my understanding? :)
And does `cleanup_speculative` happen during `t->filter_speculative(_type)`, right?
> src/hotspot/share/opto/cfgnode.cpp line 1365:
>
>> 1363: ft = t->filter_speculative(first_ft);
>> 1364: #ifdef ASSERT
>> 1365: // The following logic has been moved into TypeOopPtr::filter.
>
> Why does this mean? What logic are you referring to? The one here? But then you say it was moved to TypeOopPtr::filter ...but it is still here? Can you clarify?
Or are you saying it is moved "from" rather than "into", i.e. this is some sort of code duplication?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28331#discussion_r2541436857
PR Review Comment: https://git.openjdk.org/jdk/pull/28331#discussion_r2541500034
More information about the hotspot-compiler-dev
mailing list