review (S) for 7004940: CTW: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG

Tom Rodriguez tom.rodriguez at oracle.com
Thu Dec 9 12:04:46 PST 2010


On Dec 9, 2010, at 11:39 AM, Vladimir Kozlov wrote:

> Thank you, Tom
> 
> I thought we can avoid keeping alive two LRGs in pred block
> by changing input of rematerialized node to latest LRG which
> have the same value. Will coalesce do it later?

You could do it that way but then we have to reprocess the blocks after we've completed phi node splitting and recompute reaching defs.  Coalesce should merge them if it's possible.

> 
> Changes look good.

Thanks.

tom

> 
> Thanks,
> Vladimir
> 
> Tom Rodriguez wrote:
>> http://cr.openjdk.java.net/~never/7004940
>> 7004940: CTW: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG
>> Reviewed-by:
>> When splitting an LRG involving a phi the processing of the phi is
>> delayed to the end and it is split by inserting copies in each of the
>> predecessor blocks and then merging the new splits with the phi into a
>> single LRG.  The merging is done blindly after all the phis have been
>> split.  Usually this is fine because all MSCs are inserted at the end
>> of the predecessor and they are disjoint LRGs by definition.  The
>> problem comes when rematerialization is done because this adds an
>> extra use mixed in with the MSCs and that use might be the same LRG as
>> one of the phis that was just split.  If the rematerialize is done
>> first then it all works out because of insertion order but if it's
>> done afterwards then you can get the failure we're seeing.  The fix is
>> insert the rematerialized nodes above the MSCs that were inserted
>> during the phi node splitting process.  I also added/fixed some of the
>> printing code in PhaseChaitin.  Tested with full ctw on sparc 32 and
>> 64 bit.



More information about the hotspot-compiler-dev mailing list