RFR(M): 8182471: [MVT] Eliminate redundant value type allocations

Tobias Hartmann tobias.hartmann at oracle.com
Mon Jun 19 12:46:01 UTC 2017


please review the following patch:

The optimization removes redundant value type allocations by searching for a dominating allocation and re-using it to replace the dominated allocation. This is done during loop optimizations because the GVN version of is_dominator() and also MemNode::all_controls_dominate() are not strong/good enough. To find candidate allocations, we now keep an edge from the ValueTypeNode to the AllocateNode (see ValueTypeNode::allocate()) and let GVN take care of merging identical value type nodes. In ValueTypeNode::remove_redundant_allocations() we then check for ValueTypeNodes with multiple AllocateNodes and eliminate redundant ones (see test85-86).

I also added code to recognize cases when we copy a value type by "manually" loading its field values from memory. In this case, we can re-use the oop (see test87-90) and avoid allocations.

In addition, I did some re-naming of ValueTypeNode methods.

All JPRT tests pass.

Best regards,

More information about the valhalla-dev mailing list