[9] RFR (S): 8164954: split_if creates empty phi and region nodes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[9] RFR (S): 8164954: split_if creates empty phi and region nodes

Nils Eliasson
Hi,

Please review.

The test runtime/Metaspace/FragmentMetaspace.java triggered an assert (assert(i < _max) failed: oob: i=1, _max=1) when Node::dominates reads in[] out of bounds on a empty region node.

The empty region node is created by split_if. Split_if tries to simplify compares on a constant and a phi, where the phi has at least one constant on an in edge. In this case the opportunity for optimization is identified, and a phi and accompanying region node is created for all remaining in-edges that aren't matching the constant. But here all the in-edges to the phi matches the constant, and no edge will be split out, leaving the new nodes without in-edges. Much later in the optimization phase the empty region node will trigger the assert.

Solution:
Abort split_if when all in-edges are the same constant - this is already the desired state. It will be folded later.

https://bugs.openjdk.java.net/browse/JDK-8164954
http://cr.openjdk.java.net/~neliasso/8164954/webrev/

A big thank you to Richard Bäckman that helped me track this bug down.

Regards,
Nils
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [9] RFR (S): 8164954: split_if creates empty phi and region nodes

Vladimir Ivanov
Looks good.

Best regards,
Vladimir Ivanov

On 3/6/17 5:15 PM, Nils Eliasson wrote:

> Hi,
>
> Please review.
>
> The test runtime/Metaspace/FragmentMetaspace.java triggered an assert
> (assert(i < _max) failed: oob: i=1, _max=1) when Node::dominates reads
> in[] out of bounds on a empty region node.
>
> The empty region node is created by split_if. Split_if tries to simplify
> compares on a constant and a phi, where the phi has at least one
> constant on an in edge. In this case the opportunity for optimization is
> identified, and a phi and accompanying region node is created for all
> remaining in-edges that aren't matching the constant. But here all the
> in-edges to the phi matches the constant, and no edge will be split out,
> leaving the new nodes without in-edges. Much later in the optimization
> phase the empty region node will trigger the assert.
>
> Solution:
> Abort split_if when all in-edges are the same constant - this is already
> the desired state. It will be folded later.
>
> https://bugs.openjdk.java.net/browse/JDK-8164954
> http://cr.openjdk.java.net/~neliasso/8164954/webrev/
>
> A big thank you to Richard Bäckman that helped me track this bug down.
>
> Regards,
> Nils
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [9] RFR (S): 8164954: split_if creates empty phi and region nodes

Vladimir Kozlov
In reply to this post by Nils Eliasson
Good.

Thanks,
Vladimir K

On 3/6/17 6:15 AM, Nils Eliasson wrote:

> Hi,
>
> Please review.
>
> The test runtime/Metaspace/FragmentMetaspace.java triggered an assert
> (assert(i < _max) failed: oob: i=1, _max=1) when Node::dominates reads
> in[] out of bounds on a empty region node.
>
> The empty region node is created by split_if. Split_if tries to simplify
> compares on a constant and a phi, where the phi has at least one
> constant on an in edge. In this case the opportunity for optimization is
> identified, and a phi and accompanying region node is created for all
> remaining in-edges that aren't matching the constant. But here all the
> in-edges to the phi matches the constant, and no edge will be split out,
> leaving the new nodes without in-edges. Much later in the optimization
> phase the empty region node will trigger the assert.
>
> Solution:
> Abort split_if when all in-edges are the same constant - this is already
> the desired state. It will be folded later.
>
> https://bugs.openjdk.java.net/browse/JDK-8164954
> http://cr.openjdk.java.net/~neliasso/8164954/webrev/
>
> A big thank you to Richard Bäckman that helped me track this bug down.
>
> Regards,
> Nils
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [9] RFR (S): 8164954: split_if creates empty phi and region nodes

Nils Eliasson
In reply to this post by Vladimir Ivanov
Thank you Vladimir and Vladimir!

Best regards,

Nils


On 2017-03-06 15:58, Vladimir Ivanov wrote:

> Looks good.
>
> Best regards,
> Vladimir Ivanov
>
> On 3/6/17 5:15 PM, Nils Eliasson wrote:
>> Hi,
>>
>> Please review.
>>
>> The test runtime/Metaspace/FragmentMetaspace.java triggered an assert
>> (assert(i < _max) failed: oob: i=1, _max=1) when Node::dominates reads
>> in[] out of bounds on a empty region node.
>>
>> The empty region node is created by split_if. Split_if tries to simplify
>> compares on a constant and a phi, where the phi has at least one
>> constant on an in edge. In this case the opportunity for optimization is
>> identified, and a phi and accompanying region node is created for all
>> remaining in-edges that aren't matching the constant. But here all the
>> in-edges to the phi matches the constant, and no edge will be split out,
>> leaving the new nodes without in-edges. Much later in the optimization
>> phase the empty region node will trigger the assert.
>>
>> Solution:
>> Abort split_if when all in-edges are the same constant - this is already
>> the desired state. It will be folded later.
>>
>> https://bugs.openjdk.java.net/browse/JDK-8164954
>> http://cr.openjdk.java.net/~neliasso/8164954/webrev/
>>
>> A big thank you to Richard Bäckman that helped me track this bug down.
>>
>> Regards,
>> Nils

Loading...