RFR: 8279947: Remove two redundant gvn.transform calls in Parse::do_one_bytecode()

Vladimir Kozlov kvn at openjdk.java.net
Thu Jan 13 04:33:23 UTC 2022


On Thu, 13 Jan 2022 03:47:37 GMT, Jie Fu <jiefu at openjdk.org> wrote:

> Hi all,
> 
> May I get reviews for this small change?
> 
> The patch removes two `gvn.transform` calls in `Parse::do_one_bytecode()` which I think they are redundant.
> Or am I missing something?
> 
> Testing:
>   - tier1~3 on Linux/x64, no regression
> 
> Thanks.
> Best regards,
> Jie

Good.

Note, it only affects 32-bit VM. And we are not testing it.

Second `transform()` was replacement for `precision_rounding()` in [JDK-4416902](https://bugs.openjdk.java.net/browse/JDK-4416902) fix.

   case Bytecodes::_l2f:
     a = pop_pair(); 
     b = _gvn.transform( new (2) ConvL2FNode(a));
-    c = precision_rounding(b);
+    // For i486.ad, FILD doesn't restrict precision to 24 or 53 bits.
+    // Rather than storing the result into an FP register then pushing
+    // out to memory to round, the machine instruction that implements
+    // ConvL2D is responsible for rounding.
+    // c = precision_rounding(b);
+    c = _gvn.transform(b);
     push(c);
     break;


I think it was not necessary because main fix was done in x86_32.ad file by using `FSTP_S/FSTP_D` instructions to do correct rounding:

-instruct convL2F_reg( regF dst, eRegL src) %{
+instruct convL2F_reg( stackSlotF dst, eRegL src) %{
   match(Set dst (ConvL2F src));
...
-  ins_encode(convert_long_double(src), Pop_Reg_F(dst));
+  ins_encode(convert_long_double(src), Pop_Mem_F(dst));

-------------

Marked as reviewed by kvn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7059


More information about the hotspot-compiler-dev mailing list