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

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Nov 15 01:18:28 UTC 2019


I second this.

Vladimir K.

On 11/14/19 12:31 AM, Vladimir Ivanov wrote:
> 
> 
>> Webrev: http://cr.openjdk.java.net/~phedlin/tr8220376/
> 
> I just briefly looked through the patch and have a quick high-level question:
> 
> +  // Rewrite:
> +  //              cmp                   cmp
> +  //              / \                    |
> +  //     (r1)  bool  \                  bool (r1)
> +  //            /    bool (r2)            \
> +  //    (dom) if       \        ==>       if
> +  //            \       )                  \
> +  //    (pre)  if[TF]  /                  if[TF]X
> +  //               \  /
> +  //                if (this)
> +  //               /  \
> +  //             ifT  ifF [X]
> 
> Why do you do complex graph surgery instead of simply adjusting condition at redundant If (to 0/1) and let existing 
> logic to eliminate it?
> 
> Best regards,
> Vladimir Ivanov
> 
>>
>> 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