Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8367624

C2: Missed Value() optimization opportunities in PhaseIterGVN

XMLWordPrintable

      There are missed Value optimization opportunities in Valhalla. Filing it as an umbrella issue, feel free to split into separate issues.

      Test: compiler/valhalla/inlinetypes/TestCallingConvention.java
      VM args: -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:VerifyIterativeGVN=1110
      Platforms: windows-x64-debug (might just be intermittent and failing on other platforms as well)
      Output:

      Missed Value optimization:
      dist dump
      ---------------------------------------------
         3 1241 CallStaticJava === 1402 1419 1709 8 1 (1300 1132 1240 1 1 1 1 1 1 270 1 1 1 1 1 1 1 1 1 1 ) [[ 1256 1257 1258 1270 1267 1268 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(LL)L java/lang/Object * ( java/lang/invoke/MethodHandle (java/lang/constant/Constable):NotNull *, java/lang/Object *, java/lang/Object * ) Invokers$Holder::invokeExact_MT @ bci:20 DirectMethodHandleAccessor::invokeImpl @ bci:55 (line 155) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565) !jvms: Invokers$Holder::invokeExact_MT @ bci:20 DirectMethodHandleAccessor::invokeImpl @ bci:55 (line 155) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565)
         3 1474 CallStaticJava === 1634 1651 1701 8 1 (1532 1158 1 1 1 1 1 1 270 1 1 1 1 1 1 1 1 1 ) [[ 1488 1489 1490 1502 1499 1500 ]] # Static java.lang.invoke.MethodHandle::invokeBasic(L)L java/lang/Object * ( java/lang/invoke/MethodHandle (java/lang/constant/Constable):NotNull *, java/lang/Object * ) Invokers$Holder::invokeExact_MT @ bci:19 DirectMethodHandleAccessor::invokeImpl @ bci:41 (line 154) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565) !jvms: Invokers$Holder::invokeExact_MT @ bci:19 DirectMethodHandleAccessor::invokeImpl @ bci:41 (line 154) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565)
         3 1261 Catch === 1256 1257 [[ 1262 1263 ]] !jvms: Invokers$Holder::invokeExact_MT @ bci:20 DirectMethodHandleAccessor::invokeImpl @ bci:55 (line 155) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565)
         3 1493 Catch === 1488 1489 [[ 1494 1495 ]] !jvms: Invokers$Holder::invokeExact_MT @ bci:19 DirectMethodHandleAccessor::invokeImpl @ bci:41 (line 154) DirectMethodHandleAccessor::invoke @ bci:23 (line 104) Method::invoke @ bci:102 (line 565)


      Test: compiler/valhalla/inlinetypes/TestLWorld.java
      VM args: -XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0 -XX:VerifyIterativeGVN=1110
      Output:

      Missed Value optimization:
      dist dump
      ---------------------------------------------
         3 102 CheckCastPP === 5 27 [[ 434 421 ]] #narrowoop: compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) * (speculative=flat:narrowoop: compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):NotNull:exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact:flat(+bot):null free * (inline_depth=2)) !jvms: 0x000000002508c800::invoke_MT @ bci:24 TestLWorld::test35 @ bci:6 (line 1134)
         3 426 IfTrue === 425 [[ 440 434 ]] #1 !jvms: TestLWorld$Code_0::setArrayElementNull @ bci:3 0x000000002508d000::invokeStatic @ bci:18 0x000000002508c800::invoke_MT @ bci:24 TestLWorld::test35 @ bci:6 (line 1134)
         3 677 If === 475 676 [[ 678 679 ]] P=0.000001, C=-1.000000 !orig=[492] !jvms: TestLWorld$Code_0::setArrayElementNull @ bci:3 0x000000002508d000::invokeStatic @ bci:18 0x000000002508c800::invoke_MT @ bci:24 TestLWorld::test35 @ bci:6 (line 1134)
         3 504 Bool === _ 503 [[ 505 ]] [ne] !jvms: TestLWorld$Code_0::setArrayElementNull @ bci:3 0x000000002508d000::invokeStatic @ bci:18 0x000000002508c800::invoke_MT @ bci:24 TestLWorld::test35 @ bci:6 (line 1134)
         2 434 CastPP === 426 102 [[ 496 501 436 436 446 479 479 457 458 458 469 ]] #narrowoop: compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull * (speculative=flat:narrowoop: compiler/valhalla/inlinetypes/MyValue1 (compiler/valhalla/inlinetypes/MyInterface):NotNull:exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact:flat(+bot):null free * (inline_depth=2)) !jvms: TestLWorld$Code_0::setArrayElementNull @ bci:3 0x000000002508d000::invokeStatic @ bci:18 0x000000002508c800::invoke_MT @ bci:24 TestLWorld::test35 @ bci:6 (line 1134)
         2 678 IfFalse === 677 [[ 505 501 ]]

            Unassigned Unassigned
            chagedorn Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: