RFR: 8352635: Improve inferencing of Float16 operations with constant inputs [v11]
Emanuel Peter
epeter at openjdk.org
Thu Jun 19 07:35:11 UTC 2025
On Thu, 19 Jun 2025 07:08:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Adding a stricter constant type check
>
> src/hotspot/share/opto/convertnode.cpp line 285:
>
>> 283: if (conF != nullptr &&
>> 284: varS != nullptr &&
>> 285: conF->bottom_type()->isa_float_constant() &&
>
> Yes, it might well have come from here, because `is_float_constant` asserts if it is not a float constant.
>
> But now you have an implicit null check, right? You should make it explicit, as per the guidelines.
`src/hotspot/share/opto/type.hpp:301:21: const TypeF *isa_float_constant() const; // Returns null if not a FloatCon`
It returns a pointer, not a boolean. So you should write `conF->bottom_type()->isa_float_constant() != nullptr`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24179#discussion_r2156340988
More information about the hotspot-compiler-dev
mailing list