facebookresearch / CompilerGym

Reinforcement learning environments for compiler and program optimization tasks
https://compilergym.ai/
MIT License
906 stars 127 forks source link

After I change llvm version in CompilerGym, I find many datasets do work. How to solve the problem? #808

Closed sunpeng2020 closed 1 year ago

sunpeng2020 commented 1 year ago

❓ Questions and Help

I change the llvm version from 10.0.0 to 8.0.1 in CompilerGym. But I find many datasets and benchmarks do work. I think it's because the .bc files in the benchmarks are compiled by llvm 10.0.0, but now the llvm version is 8.0.1, so there is a version collision. The llvm 8.0.1 can deal with the compiled .bc files of the benchmarks of CompilerGym. If I want to use the datasets and benchmarks provided by CompilerGym, how can I sovle the problem?

Additional Context

ChrisCummins commented 1 year ago

Hi @sunpeng2020, we made the decision when first building CompilerGym to prefer shipping benchmarks as LLVM bitcodes, which unfortunately means that changing LLVM versions will likely break things, as you have noticed.

Note some benchmarks are compiled from C/C++ source and so will work fine with LLVM-8:

Also generator://llvm-stress-v0 should be easy to port to LLVM-8 by just swapping the llvm-stess binary for the correct version.

For all other datasets the only option would be to build equivalent new ones from source.

Cheers, Chris