Closed chao-peng closed 1 year ago
Hi @chao-peng, CompilerGym uses LLVM 10.0.0, and there no compatibility guarantees between LLVM versions. Unfortunately, that means that your LLVM 9 bitcodes will not work. I'd suggest two workarounds:
cmake ... \
-DCOMPILER_GYM_LLVM_PROVIDER=external \
-DLLVM_DIR=/path/to/llvm-9/lib/cmake/llvm
See the full instructions here. Note that this may require changes to CompilerGym's sources as it is very tightly coupled with the LLVM codebase. For example, optimization passes that are new or renamed between LLVM 9 and 10 will break this file.
Cheers, Chris
Note we do have plans to add support for other LLVM versions (#568), but this will require some significant engineering work on the backend.
Closing this as not a supported feature as of yet, but feel free to follow up with any further questions.
Cheers, Chris
🐛 Bug
Bitcode generated is not recognised by LLVM 9
To Reproduce
Steps to reproduce the behavior:
Benchmark code
Error
compiler_gym.errors.dataset_errors.BenchmarkInitError: Failed to initialize benchmark benchmark://user-v0/20230110T104153-1e11: Failed to compute .text size cost. Command returned exit code 1: /home/pengchao/.local/share/compiler_gym/llvm-v0/bin/clang -w -xir - -o /dev/shm/compiler_gym_pengchao/s/0117T104153-330254-6905/obj-24be.o -c. Error::55:196: error: expected ')' at end of argument list
define available_externally dso_local dereferenceable(272) %"class.std::basic_ostream" @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(%"class.std::basic_ostream" dereferenceable(272) %0, i8* %1) #4 {
^
1 error generated.
Expected behavior
Environment
Please fill in this checklist:
You may use the environment collection script to generate most of this information. You can get the script and run it with:
Additional context