RFR: 8342975: C2: Micro-optimize PhaseIdealLoop::Dominators() [v2]

Aleksey Shipilev shade at openjdk.org
Fri Oct 25 05:52:39 UTC 2024


On Thu, 24 Oct 2024 23:21:17 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Better comment
>
> src/hotspot/share/opto/domgraph.cpp line 413:
> 
>> 411:   // Note: Tarjan uses 1-based arrays
>> 412:   NTarjan *ntarjan = NEW_RESOURCE_ARRAY(NTarjan,C->unique()+1);
>> 413:   // Initialize all fields for safety.
> 
> This is also a performance optimization so the comment should probably say so, so we remember not to change it back to a loop later on.  It might be nice to have NEW_RESOURCE_ARRAY do the initialization for us, like calloc.

I mean, this is a common style in C2 to initialize things with `memset`, so I treated it more as "do the same thing as everywhere else", and having perf bump as a nice bonus. I blurped about performance in new comment, see new commit.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21690#discussion_r1816033246


More information about the hotspot-compiler-dev mailing list