RFR(M): 8220376: C2: Int >0 not recognized as !=0 for div by 0 check

Patric Hedlin patric.hedlin at oracle.com
Tue Nov 26 14:29:51 UTC 2019


Thanks Dean,

I should take a look for the full patch.

Best regards,
Patric

On 14/11/2019 06:12, dean.long at oracle.com wrote:
> Hi Patric.  I was expecting the fix to allow the following existing 
> logic in DivINode::Ideal to work:
>
>   // Check for excluding div-zero case
>   if (in(0) && (ti->_hi < 0 || ti->_lo > 0)) {
>     set_req(0, NULL);           // Yank control input
>     return this;
>   }
>
> by making sure the range of "ti" has been sharpened by the previous 
> if-node.  I was just wondering if you looked at that solution and 
> thought it was feasible.  I see Parse::sharpen_type_after_if() is 
> almost doing the right thing, but only handles BoolTest::eq.
>
> dl
>
> On 11/12/19 6:16 AM, Patric Hedlin wrote:
>> Dear all,
>>
>> I would like to ask for help to review the following change/update:
>>
>> Issue:  https://bugs.openjdk.java.net/browse/JDK-8220376
>> Webrev: http://cr.openjdk.java.net/~phedlin/tr8220376/
>>
>> 8220376: C2: Int >0 not recognized as !=0 for div by 0 check
>>
>>     Adding a simple subsumption test to IfNode::Ideal to enable a local
>>     short-circuit for (obviously) redundant if-nodes.
>>
>> Testing: hs-tier1-4, hs-precheckin-comp
>>
>>
>> Best regards,
>> Patric
>>
>



More information about the hotspot-compiler-dev mailing list