how can i get llvm ir?
Version: hhvm 3.14.2 Problem: with a php file as input, i wonder if there is a way to generate llvm ir by hhvm.
Since the LLVM backend has been removed, I don't think it's possible to get LLVM IR.
just a little more background...
We built an LLVM backend: http://hhvm.com/blog/10205/llvm-code-generation-in-hhvm http://devmtg15.llvm.org/event/4UIA/llvm-back-end-for-hhvmphp
We maintained it for a while, but as Simon mentioned (and explain in the blog posts) it wasn't strictly better than our VASM-based backend, the compilation speed was slower, and it was a maintenance burden. So it eventually was deleted https://github.com/facebook/hhvm/commit/68a76afc3e5faf16e778708d50926f644c1fc925
You could try an old release of HHVM if you really want to see what the LLVM-IR looked like.
The LLVM backend was also never enabled in any open source build.
thanks for your replies! perhaps i still need the llvm ir result. which old version of hhvm should I use? And which one should I install from, package or source code?
None of the packages will have the LLVM backend enabled, and you would have to do some work on the CMake files to be able to build the LLVM backend at all. The LLVM backend was removed before 3.13.0 was released, so you would have to build with a commit prior to that.
not really documentation as this isn't/hasn't been supported, and we're not expecting the backend to be re-introduced..