RFR: 8345766: C2 should emit macro nodes for ModF/ModD instead of calls during parsing [v2]

Theo Weidmann tweidmann at openjdk.org
Thu Jan 9 09:59:05 UTC 2025


On Wed, 8 Jan 2025 07:57:25 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Suggestion:
>> 
>>   if (in(0) == nullptr || phase->type(in(0)) == Type::TOP) {
>> 
>> 
>> `Do not use ints or pointers as (implicit) booleans with &&, ||, if, while. Instead, compare explicitly, i.e. if (x != 0) or if (ptr != nullptr), etc.`
>> 
>> See
>> https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md
>
> Why can this now be nullptr?

This can happen due to the idealizations implemented for ModF/ModD nodes. The same code is also in Valhalla already, btw.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22786#discussion_r1908466767


More information about the hotspot-compiler-dev mailing list