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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Nov 14 08:31:12 UTC 2019



> 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