1

A green-hand in Java.

I'm using Azul System's Falcon JIT compiler. Is it possible to dump decision of choosing what optimization passes to run on the hotspot code?

Moreover, in Oracle's JVM, is it possible to add option to java to show what optimizaiton passes are chosen to optimize the hotspot code?

I'm not familiar with java's toolchain and infrastructure literally.

edit:

Here optimization passes I mean are Transforming passes like function inlining, dead code elimination, constant propogation and some Analysis passes like callgraph analysis for interprocedure optimization and escape analysis for allocating objects in stack and eliminating synchronization operation.

My purpose is to learn some transformations Falcon compiler does in the LLVM IR. By using java -XX:FalconIRDumpRoot=./falcon-ir/ -XX:FalconDumpIRToDiskOf=* myClassName, Falcon compiler can dump .ll and .opt.ll if hotspots are observed. The former LLVM IR is not optimized while the latter IR is optimized using some intrinsics introduced by Azul's LLVM fork which is called "Orca" to replace the init call for object initilization. Since I can use -debug-pass-manager(for new pass manager) or --debug-pass=Structure(for legacy pass manager) in LLVM to print what optimization passes are used during the compilation, I wonder whether Falcon compiler or Azul JVM also provide such options to show what optimization Falcon decide to use for hotspot code.

the documentation of Falcon compiler only provide some option to dump IR for Azul Support to assist in analyzing performance issues. It's a blackbox. And I have just find some technique reports for some passes, like Escape Analysis and VM callbacks to acquire information from VM. Is there any other JIT compiler like Falcon whose backend is also based on LLVM and using GC to manage memory and most importantly able to print optimization decision when running? Language is not limited to Java.

Printing compilation levels and tracing particular compilation phases are both wanted, since I'm now using Falcon as a blackbox.

Qingwei Li
  • 11
  • 2
  • What are you trying to achieve by doing this? – Rogue Oct 19 '22 at 15:38
  • What do you mean by optimization passes here? Do you want to print compilation levels (e.g. Tier 1-2-3-4) or are you interested in tracing particular compilation phases (e.g. loop optimizations)? Please give an example or clarify the original problem. – apangin Oct 19 '22 at 15:45
  • There are a lot of flags for diagnosing the Hotspot C2 compiler which include [machine independent](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/c2_globals.hpp) and [machine dependent](https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/c2_globals_x86.hpp) ones. – Quân Anh Mai Dec 20 '22 at 10:34

1 Answers1

-3

@Qingwei Li I did not understand clearly what passses you talking about. But if you talking about GC options for JVM tuning and seeing. For Azul -Xloggc:gclogfile_%t_%p.log help you look into option you using. You can use https://docs.azul.com/prime/diagnosing-java-performance-problems-with-gc-log-analyzer.html to analyze the log file option. OR you can use this -Xlog:gc,safepoint:gc.log::filecount=0 if you want log in one file.

In Oracle JVM, -Xlog:gc,safepoint:gc.log::filecount=0

Let me know if I understood right. Hope this can help you.