Is it possible to integrate LLVM with JVM Runtime. I am interested in this perf optimization Azul Zing already does that but is possible to do it with Oracle's JVM or OpenJDK ?
-
1This is crazy. Why is the question downvoted ? – Piyush Katariya Jul 08 '18 at 12:41
-
The question could easily be seen as too broad or asking for off site resources. It is for sure not crazy to have some downvotes on it... – GhostCat Jul 08 '18 at 13:58
-
Especially in this context, this question does not require writing blog post and explaining every other detail. – Piyush Katariya Jul 08 '18 at 14:03
-
You asked, and I gave an explanation. And I appreciate the quick comeback. – GhostCat Jul 08 '18 at 15:11
-
You could ask them for a trail license to see what difference it makes. – Peter Lawrey Jul 11 '18 at 10:37
2 Answers
You simply start studying/using the graal vm.
Universal VM for a polyglot world. Our mission: Make development more productive and run programs faster anywhere.
( not to mix up with the graal compiler, a java-to-native compiler, which is already shipped with the JDK since Java 9 )
In other words: we are already on the move.

- 137,827
- 25
- 176
- 248
-
You mean GraalVM takes advantage of Sulong ? https://github.com/graalvm/sulong Please clarify. Will it be good as LLVM ? – Piyush Katariya Jul 08 '18 at 12:44
It is unlikely to be feasible for you to integrate LLVM with OpenJDK or Oracle JDK. (OpenJDK or Oracle JDK are pretty much the same thing anyway ... from a technical perspective.)
You would need to repeat all of the development work that the Azul team have done to get their LLVM-based compilers to work with a JVM. That is unlikely to be practical for you.
I am interested in this perf optimization Azul Zing already does that but is possible to do it with Oracle's JVM or OpenJDK ?
It may be possible1 to implement those optimizations by modifying the existing OpenJDK code-base.
GraalVM looks like another option. (What GhostCat didn't mention in his answer is that GraalVM supports LLVM-based compilers. So if you had an LLVM-based compiler for Java, you could use that as the basis for your optimizer work.)
1 - It is not clear whether Azul took the LLVM approach for technical reasons, or for licensing reasons, or both. If they took the approach of modifying the OpenJDK JIT compiler, they would be obliged to publish their source code.

- 698,415
- 94
- 811
- 1,216