JDK-8138751 : JEP 165 (CompilerControl) changes break JMH @CompilerControl tests
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-10-02
  • Updated: 2015-10-06
  • Resolved: 2015-10-06
Related Reports
Blocks :  
Blocks :  
Description
(feel free to make this a subtask for JEP 165)

The latest webrev from Nils:
  http://cr.openjdk.java.net/~neliasso/8046155/webrev.03/ 

...regresses JMH @CompilerControl tests. 

$ wget http://cr.openjdk.java.net/~shade/jmh/jmh-core-benchmarks.jar
$ java -jar jmh-core-benchmarks.jar -t compiler_hints -m quick

This is baseline JDK 9:

--------- COMPILER HINTS TEST

  This tests verifies compiler hints are working as expected. Two baseline tests 
  run the workloadin inlined and non-inlined regiments. When the workload is inlined, 
  the optimizations should kill the workload body. Compiler hints should successfully 
  survive in both regiments: INLINE should always inline, and DONT_INLINE should always 
  break inlining. EXCLUDE should be neutral to inlining policy completely. 

                           Default inline policy: 0.25 �� 0.00 ns
                      + @CompilerControl(INLINE): 0.25 �� 0.00 ns
                 + @CompilerControl(DONT_INLINE): 17.91 �� 1.52 ns
                     + @CompilerControl(EXCLUDE): 59.53 �� 1.73 ns

                        Default no inline policy: 17.46 �� 0.02 ns
                      + @CompilerControl(INLINE): 0.25 �� 0.00 ns
                 + @CompilerControl(DONT_INLINE): 17.47 �� 0.06 ns
                     + @CompilerControl(EXCLUDE): 59.49 �� 0.38 ns

And this is current JEP 165:

--------- COMPILER HINTS TEST

  This tests verifies compiler hints are working as expected. Two baseline tests 
  run the workloadin inlined and non-inlined regiments. When the workload is inlined, 
  the optimizations should kill the workload body. Compiler hints should successfully 
  survive in both regiments: INLINE should always inline, and DONT_INLINE should always 
  break inlining. EXCLUDE should be neutral to inlining policy completely. 

                           Default inline policy: 49.90 �� 4.17 ns
                      + @CompilerControl(INLINE): 48.40 �� 0.15 ns
                 + @CompilerControl(DONT_INLINE): 48.34 �� 0.15 ns
                     + @CompilerControl(EXCLUDE): 48.42 �� 0.24 ns

                        Default no inline policy: 26.31 �� 0.10 ns
                      + @CompilerControl(INLINE): 26.41 �� 0.29 ns
                 + @CompilerControl(DONT_INLINE): 26.34 �� 0.21 ns
                     + @CompilerControl(EXCLUDE): 26.31 �� 0.09 ns



Comments
Confirmed. Thanks!
06-10-2015

After a fix to excludes I get these numbers that looks good to: neliasso@neliasso04:~/benchmarks$ /home/neliasso/repos/compiler_control/build/linux-x86_64-normal-server-release/images/jdk/bin/java -jar jmh-core-benchmarks.jar -t compiler_hints -m quick JMH Core Benchmarks, Validation Tests ... Default inline policy: 0.42 �� 0.01 ns + @CompilerControl(INLINE): 0.41 �� 0.04 ns + @CompilerControl(DONT_INLINE): 28.64 �� 1.89 ns + @CompilerControl(EXCLUDE): 107.95 �� 4.73 ns Default no inline policy: 28.82 �� 0.38 ns + @CompilerControl(INLINE): 0.42 �� 0.01 ns + @CompilerControl(DONT_INLINE): 28.68 �� 0.17 ns + @CompilerControl(EXCLUDE): 102.65 �� 19.99 ns neliasso@neliasso04:~/benchmarks$ /home/neliasso/images/jdk1.9.0_b79/bin/java -jar jmh-core-benchmarks.jar -t compiler_hints -m quick JMH Core Benchmarks, Validation Tests ... Default inline policy: 0.42 �� 0.00 ns + @CompilerControl(INLINE): 0.42 �� 0.00 ns + @CompilerControl(DONT_INLINE): 28.83 �� 0.66 ns + @CompilerControl(EXCLUDE): 107.60 �� 4.18 ns Default no inline policy: 28.90 �� 0.65 ns + @CompilerControl(INLINE): 0.43 �� 0.02 ns + @CompilerControl(DONT_INLINE): 28.88 �� 0.59 ns + @CompilerControl(EXCLUDE): 108.52 �� 5.51 ns
06-10-2015