RFR: 8220502: Inefficient pre-sizing of PhiResolverState arrays in c1_LIRGenerator
vladimir.kozlov at oracle.com
Wed Mar 13 23:31:16 UTC 2019
Claes, did experiment with reserving more space only for _other_operands(LIR_OprDesc::vreg_base).
It showed that "slight reduction in ::grow calls, but overall more instructions per operation,
Based on this I think changes are good. Reviewed.
On 3/13/19 12:22 PM, Claes Redestad wrote:
> 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