RFR (S) JDK-8001345: VM crashes with assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Jun 18 07:55:02 PDT 2013
Three things.
Code style - put parenthesis around equivalences "( != ) && ( == )"
Comment: // The MembarAquire may keep an unused LoadNode alive through the Precedent edge
delete_input_of() call is not useful here, since we already process membar. Instead we need to put load node on worklist
so it will be removed from graph (there is code which check outcnt in PhaseIterGVN::optimize()):
hash_delete(this);
del_req(Precedent);
phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later
Thanks,
Vladimir
On 6/18/13 12:06 AM, Niclas Adlertz wrote:
> Roland, Vladimir, thank you for the feedback.
>
> http://cr.openjdk.java.net/~adlertz/JDK-8001345/webrev02/
>
> Kind Regards,
> Niclas Adlertz
>
>
> On 17 jun 2013, at 14:43, Niclas Adlertz <niclas.adlertz at oracle.com> wrote:
>
>> 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