RFR: 8215477: [lworld] C2 should avoid value type allocations when inlining incrementally

Tobias Hartmann tobias.hartmann at oracle.com
Mon Feb 11 14:38:04 UTC 2019


Hi Roland,

Very nice!

I think you can use igvn.remove_dead_node(n) in compile.cpp:2082.

On 11.02.19 13:46, Roland Westrelin wrote:
> - the GraphKit::set_arguments_for_java_call() change so for an
>   incremental inlining call, a value type argument input uses a
>   ValueTypePtrNode.

Just wondering, why not always create a ValueTypePtrNode here?

> I also added a new test case an for that one, I found that a common code
> pattern for value fields when they are initialized is:
> 
> if (!value allocated) {
>    allocate value
> }
> 
> which once the allocation is found to be useless leaves an
> InitializeNode in the branch of the test and prevents the test to be
> optimized away which in turns can keep another allocation live. To fix
> that, AllocateNode::Ideal() removes the InitializedNode. A change to the
> handling of PhiNode is also require to handle the somewhat strange
> memory graph pattern that removing the allocation leaves.

Good catch!

Thanks,
Tobias



More information about the valhalla-dev mailing list