RFR (XS): 8151988: Fix for bug - Hotspot deoptimizes div/mod pair usage

Deshpande, Vivek R vivek.r.deshpande at intel.com
Thu Jul 28 22:18:10 UTC 2016

Hi Vladimir

The control edge for ModI node is NULL in find_similar() function. It is not NULL when the node is created. So it is not NULL when it comes from zero_check_int(). Looks like it is getting optimized away as it is not the first statement in the basic block.


-----Original Message-----
From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] 
Sent: Wednesday, July 27, 2016 7:54 PM
To: Deshpande, Vivek R; hotspot compiler
Cc: Viswanathan, Sandhya
Subject: Re: RFR (XS): 8151988: Fix for bug - Hotspot deoptimizes div/mod pair usage

If control edge is different (one of them not NULL) I don't think we can replace Div and Mod nodes.
Control edge enforce the order of execution of data nodes. DivModI node takes control from ModI node which can put DivModI below users of DivI node. So you will have shceduler problem.

So why control edge is NULL for DivI (or ModI) node? Control edge should come from zero_check_int() which is called for ModI and DivI nodes.


On 7/27/16 5:56 PM, dean.long at oracle.com wrote:
> How about this?  I think it gives the same result, but with fewer tests
>               if (use->in(j) != in(j) &&(j != 0 || (use->in(j) != NULL && in(j) != NULL)) {
>                 break;
>               }
> dl
> On 7/27/16 4:14 PM, Deshpande, Vivek R wrote:
>> Hi
>> I have resolved the bug and fix for the same is here.
>> http://cr.openjdk.java.net/~vdeshpande/8151988/webrev.00/
>> I have also updated the JBS entry.
>> https://bugs.openjdk.java.net/browse/JDK-8151988
>> Would you please review it.
>> Regards,
>> Vivek

More information about the hotspot-compiler-dev mailing list