RFR: 8220502: Inefficient pre-sizing of PhiResolverState arrays in c1_LIRGenerator

Claes Redestad claes.redestad at oracle.com
Wed Mar 13 19:22:21 UTC 2019

On 2019-03-13 19:15, Vladimir Kozlov wrote:
> By default GrowableArray allocate 2 elements.
> Looking on C1 code I see that it indeed you can benefit to not resizing 
> by default _virtual_operands and _vreg_table arrays. But _other_operands 
> may need to be resized to actual registers numbers I think. But it needs 
> to be verified. Also the code is used only for Phi nodes, as I 
> understand, that is why it may not have big impact regardless resizing.

Only used for Phi nodes, yes.

When instrumenting before/after, we do less than a third as many calls
to ::grow in create_node than we did from PhiResolverState::reset
before the patch. Cost of LIRGenerator::move_to_phi, which spans both 
all ::reset and all ::create_node, drops ~72%.

> In general I agree with these changes.



More information about the hotspot-compiler-dev mailing list