hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

how can i get llvm ir?

Open wangcong15 opened this issue 10 years ago • 6 comments

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.

wangcong15 avatar Jul 13 '16 06:07 wangcong15

Since the LLVM backend has been removed, I don't think it's possible to get LLVM IR.

simonwelsh avatar Jul 13 '16 09:07 simonwelsh

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.

edwinsmith avatar Jul 13 '16 14:07 edwinsmith

The LLVM backend was also never enabled in any open source build.

Orvid avatar Jul 13 '16 22:07 Orvid

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?

wangcong15 avatar Jul 14 '16 00:07 wangcong15

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.

Orvid avatar Jul 14 '16 16:07 Orvid

not really documentation as this isn't/hasn't been supported, and we're not expecting the backend to be re-introduced..

fredemmott avatar Jul 18 '16 15:07 fredemmott