facebookresearch / CompilerGym

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

Do CompilerGym have LLVM Flag Tuning? #801

Closed libin049 closed 1 year ago

libin049 commented 1 year ago

❓ Questions and Help

CompilerGym has LLVM phase ordering and GCC flag tuning. Do CompilerGym have LLVM flag tuning like GCC flag tuning? LLVM also has parameterized command line flags such as -inline-threshold=number. It seems that LLVM phase ordering cannot process command line flags like -inline-threshold=number.

Additional Context

libin049 commented 1 year ago

@ChrisCummins Could you answer above question?

ChrisCummins commented 1 year ago

Sorry for delay! No, the LLVM environment does not support flag tuning. It's on our roadmap but no timeline yet.

Your have two options:

  1. Add new actions to the LLVM environment which set the options exposed as command line flags, such as inline threshold you gave as an example.
  2. Create a new environment which wraps opt/clang and runs these actions from the command line. You could start with the GCC environment as a base, and use the LLVM datasets to get you started.

Cheers, Chris