RFR: 8323220: Reassociate loop invariants involved in Cmps and Add/Subs [v3]

Joshua Cao duke at openjdk.org
Mon Jan 22 16:57:31 UTC 2024


On Sat, 20 Jan 2024 08:29:47 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> Joshua Cao has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Assert for n2. Variables for n1/n2 opcode. More concise comments.
>>   Overflow/random tests
>
> src/hotspot/share/opto/loopTransform.cpp line 382:
> 
>> 380:     }
>> 381:     phase->register_new_node(inv, phase->get_early_ctrl(inv));
>> 382:     if (n1_is_cmp) {
> 
> CmpNode is subclass of SubNode. if n is CmpI/L, n->is_Sub() is also true. 
> can we use the old logic for your new comparison expressions? 
> 
> yes, we still need to check if n1 is CmpNode or SubNode here.

I am not following. We are explicitly checking for Cmp here. Why do we also need to check if it is a Sub?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17375#discussion_r1462145062


More information about the hotspot-compiler-dev mailing list