RFR: 8355488: Add stress mode for C2 loop peeling [v3]
Tobias Hartmann
thartmann at openjdk.org
Fri May 16 08:34:55 UTC 2025
On Fri, 16 May 2025 07:53:41 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> src/hotspot/share/opto/loopTransform.cpp line 522:
>>
>>> 520: loop_head->_peeling_opportunities_count++;
>>> 521: // In case of stress, let's just pick randomly...
>>> 522: return phase->C->random() % 2 == 0 ? estimate : 0;
>>
>> Suggestion:
>>
>> return ((phase->C->random() % 2) == 0) ? estimate : 0;
>
> Done. But does that really helps you? To me it's just more confusing. It looks like "I put parentheses because it will associate in a surprising way", and then the most normal things comes. I often wonder whether the parentheses are misplaced, or whether there is something subtle I don't get.
> But anyway, parentheses are in!
I think it just helps readability because you don't need to think about operator precedence. But it surely is personal preference.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25140#discussion_r2092590771
More information about the hotspot-compiler-dev
mailing list