RFR(S): 8210389: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc

Roland Westrelin rwestrel at redhat.com
Tue Sep 18 19:47:46 UTC 2018


http://cr.openjdk.java.net/~roland/8210389/webrev.00/

With volatile loads, the trailing membar has an edge to the load. After
optimizations, that edge can point to a chain of Phis and the membar can
be the one use that keeps the phis alive. After matching, that required
edge is converted to a precedence edge. Liveness analysis ignores
precedence edges, the chain of phis is killed and register allocation
finds a node with no use.

As a fix, I propose that, at the end of optimizations, the edge between
the volatile load's membar and the phis be removed and all dead phis be
killed. As I understand, that edge is not required for correctness
because anti dependencies detection code adds a precedence edge between
a volatile load and its membar if needed. I ran full jcstress on x86 and
aarch64 with this patch successfully.

Roland.


More information about the hotspot-compiler-dev mailing list