C2: adding things to EA
Roland Westrelin
rwestrel at redhat.com
Fri Jun 21 07:11:35 UTC 2019
> *) In SBSC2::escape_add_to_con_graph and SBSC2::escape_add_final_edges, shouldn't we add LoadAddr
> input as well, like ShenandoahCompareAndExchange does?
>
> diff -r 3f2b4cc07dbd src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
> --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp Thu Jun 06 22:24:23 2019 +0200
> +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp Fri Jun 14 11:09:51 2019 +0200
> @@ -1159,4 +1159,5 @@
> case Op_ShenandoahLoadReferenceBarrier:
> conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape,
> n->in(ShenandoahLoadReferenceBarrierNode::ValueIn), delayed_worklist);
> + conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape,
> n->in(ShenandoahLoadReferenceBarrierNode::LoadAddr), delayed_worklist);
> return true;
> default:
> @@ -1185,4 +1186,5 @@
> case Op_ShenandoahLoadReferenceBarrier:
> conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape,
> n->in(ShenandoahLoadReferenceBarrierNode::ValueIn), NULL);
> + conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape,
> n->in(ShenandoahLoadReferenceBarrierNode::LoadAddr), NULL);
> return true;
> default:
>
Not sure about that one but I would say no. We're not loading from the
address, we're simply filtering the oop that was loaded from that
address. So I suppose doing what's done for other filtering nodes like
CheckCastPP is good enough.
BTW, do we really need the LoadAddr edge? Can't we get the address from
the load that should be input to the load barrier? If there's no load
there then I suppose there should be a Phi and we could always push the
barrier through the Phi so the barrier always take a load as input. If
it doesn't then the barrier can be optimized out.
> *) Why do we only add NoEscape "adr" to CompareAndExchange, and not to CompareAndSwap? Ditto, why do
> we only do the unsafe_access for CompareAndSwap, and not to CompareAndExchange?
There's a fallthrough. So there's one thing that we do for CAE that we
don't do for CAS but there's nothing we do for CAS that we don't for
CAE, right? I think the difference is that CAE returns an oop so it
loads a value that the method can then used. That code mirrors what's
done in escape.cpp for regular CAE/CAS so should be good.
> *) ZGC also handles Op_Proj cases, do we care about those as well?
I think they have projections from their load barriers. We don't.
Roland.
More information about the shenandoah-dev
mailing list