RFR: 8352635: Improve inferencing of Float16 operations with constant inputs [v11]

Jatin Bhateja jbhateja at openjdk.org
Thu Jun 19 07:44:40 UTC 2025


On Thu, 19 Jun 2025 07:31:39 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> 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`

Kindly re-verify.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24179#discussion_r2156353660


More information about the hotspot-compiler-dev mailing list