Compiler-related Options
llvm-autotune needs to be used with the -fautotune-generate and -fautotune options of the BiSheng compiler.
- -fautotune-generate:
- The tuning opportunities are generated in the autotune_datadir directory. The default directory can be modified by setting the environment variable AUTOTUNE_DATADIR.
- As the first step of tuning preparation, you need to use the option before running the llvm-autotune minimize/maximize command.
- You can also assign a value to this option to change the tuning granularity. The value can be Other, Function, Loop, CallSite, MachineBasicBlock, Switch, LLVMParam, or ProgramParam. LLVMParam and ProgramParam correspond to coarse-grained tuning. For example, -fautotune-generate=Loop enables the tuning opportunities of the loop type. Each loop is assigned a different parameter value during tuning. Other indicates global. The generated tuning opportunities correspond to compilation units (code files).
-fautotune-generate is equivalent to -fautotune-generate=Function,Loop,CallSite by default. The default value is recommended.
- To enable a tuning option (LLVMParam or ProgramParam), you need to specify an extended search scope for llvm-autotune. The default search scope does not contain preset tuning options.
llvm-autotune minimize --search-space /path/to/python3.1x/site-packages/autotuner/search_space_config/extended_search_space.yaml
The site-packages directory can be found by running the pip show autotuner command.
- -fautotune:
- Use the compiler configuration in the autotune_datadir directory for tuning and compilation. (The default directory can be modified by setting the environment variable AUTOTUNE_DATADIR.)
- This option is used after the llvm-autotune minimize/maximize/feedback command is run during tuning iteration.
Parent topic: llvm-autotune
