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

Roland Westrelin rwestrel at redhat.com
Mon Feb 11 12:46:38 UTC 2019


The 2 changes that fix test8() are:

- Compile::process_value_types() change to make sure that when a
  ValueTypeNode, that's input to a safepoint node, goes dead because the
  value type state at the safepoint is scalarized, the ValueTypeNode is
  destroyed and any of its inputs that go dead are as well.

- the GraphKit::set_arguments_for_java_call() change so for an
  incremental inlining call, a value type argument input uses a

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.


More information about the valhalla-dev mailing list