RFR: 8324630: C1: Canonicalizer::do_LookupSwitch doesn't break the loop when the successor is found [v2]

Denghui Dong ddong at openjdk.org
Fri Jan 26 09:08:42 UTC 2024


On Fri, 26 Jan 2024 08:31:40 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Denghui Dong has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   update
>
> src/hotspot/share/c1/c1_Canonicalizer.cpp line 848:
> 
>> 846:       if (v == x->key_at(i)) {
>> 847:         sux = x->sux_at(i);
>> 848:         break;
> 
> Shouldn't we also break when `v < x->key_at(i) `, meaning no key will match?  Maybe we should consider binary search?

Updated: break when `v < x->key_at(i)`

> Maybe we should consider binary search?

>From the perspective of pursuing performance, binary search can be considered. If you agree, I can change to using binary search here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17553#discussion_r1467385164


More information about the hotspot-compiler-dev mailing list