I still can't get IR functions to JIT compile with the ORC JIT when they contain a call to the standard math library. Attached is a minimal exploit.
The program uses the KaleidoscopeJIT.h that ships with LLVM 8 (except that I had to expose the Datalayout). It reads from the filesystem an IR file (filename "func_works.ll" or "func_cos_fails.ll) and asks the ORC JIT first for the symbol "func_ir" and then for the address.
In case the file "func_works.ll" was read the program succeeds with:
In case the file "func_cos_fails.ll" was read the program fails with:
Failure value returned from cantFail wrapped call
UNREACHABLE executed at install/llvm-8.0-x86-debug/include/llvm/Support/Error.h:732!
This was tested on an x86 Linux Ubuntu system.
Does anyone see what's going on or is it time to file a bug report?
func_cos_fails.ll (219 Bytes)
func_works.ll (158 Bytes)
KaleidoscopeJIT.h (4.95 KB)
Makefile (399 Bytes)
test.cc (2.01 KB)