Request for reviews (M): 7128355: assert(!nocreate) failed: Cannot build a phi for a block already parsed
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Jan 10 16:52:01 PST 2012
Tom Rodriguez wrote:
> On Jan 10, 2012, at 3:36 PM, Vladimir Kozlov wrote:
>
>> http://cr.openjdk.java.net/~kvn/7128355/webrev
>>
>> 7128355: assert(!nocreate) failed: Cannot build a phi for a block already parsed
>>
>> Regression after 7125896 changes. Merge Phi was not created for BoxLockNode.
>> Other problems showed up after fixing this:
>> - EA did not recognize BoxLock phis. EA should ignore them.
>> - Matcher and RA does not expect box phis in debug info. Next assert was hit:
>> assert((op == Op_BoxLock) == jvms->is_monitor_use(i), "boxes only at monitor sites");
>> - Lock elimination code may miss some safepoints (because they separated by additional phi nodes) when replacing old box (which could be Phi) with new "eliminated" Box. As result debug info could be incorrect.
>>
>> Do commoning of merged Box nodes (which has Phi uses) before locks elimination to resolve these problems.
>
> Doesn't that break nested lock elimination?
Possible but rare since merged boxes are rare cases. It does not affect normal
case when Box node is unique for nested lock region. The failure I see is OSR
compilations of nested loop inside synchronized scope and compilations of
irreducible loops. The scenario where nested lock elimination will be broken is
when during first locks nodes elimination (after EA) Box node was commoned
because it has Phi user but later after CCP that Phi could be eliminated so Box
could became unique. I thought about doing box commoning only after all
optimizations done. But I concern that during first locks elimination after EA
not all safepoints will be patched.
> Two unrelated boxes that happened to participate in different Phis could end up commoned together wouldn't they? Don't you want to perform explicit Phi simplification instead, replacing the Phi and all other boxes with one of the boxes feeding the Phi?
For eliminating locks of non escaped objects it does not matter that unrelated
Boxes are commoned - it worked before. And I want this because it allows to find
all related safepoints. Consider case of different lock regions of the same non
escaped object.
Thanks,
Vladimir
>
> tom
>
>> Tested with full CTW and compiler regression tests.
>>
>> Thanks,
>> Vladimir
>
More information about the hotspot-compiler-dev
mailing list