RFR (S) JDK-8001345: VM crashes with assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
Niclas Adlertz
niclas.adlertz at oracle.com
Mon Jun 17 05:43:37 PDT 2013
Hi all,
Problem:
The uses of LoadN / DecodeN nodes can sometimes be optimized away so that they are only used as precedence nodes at MemBarAcquire nodes, which means they are no longer needed.
They are later removed when building the IFG in the register allocator, after creating the liveness. Usually this is not a problem.
But if the register allocator decides that one or more virtual registers need to be spilled, and a spilled virtual register X was used at the already removed loadN / decodeN, the split code in reg_split.cpp will create a phi node chain which reaches the place where the loadN / decodeN nodes originally existed. Eventually, this leads to an empty phi node doesn't get removed. Thus, the assert triggers.
assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
Solution:
When the ideal graph has been built, and the ideal() method is called on each node in an attempt to optimize the graph, we look for unnecessary LoadN / DecodeN nodes at MemBarAcquire nodes, and remove them so that no "dead" nodes of this kind can reach the register allocator in the first place.
WEBREV: http://cr.openjdk.java.net/~adlertz/JDK-8001345/webrev00
JBS: https://jbs.oracle.com/bugs/browse/JDK-8001345
Kind Regards,
Niclas Adlertz
More information about the hotspot-compiler-dev
mailing list