LLVM gives you the opportunity to fine-tune optimization passes. Optimization passes are managed by a pass manager. There are 2 kinds of pass managers:
FunctionPassManager, for optimizations that work on single functions.
ModulePassManager, for optimizations that work on whole modules.
To instantiate either of these pass managers, you first need to
create and configure a
- class llvmlite.binding.PassManagerBuilder¶
Create a new pass manager builder. This object centralizes optimization settings.
populatemethod is available:
Populate the pass manager pm with the optimization passes configured in this pass manager builder.
The following writable attributes are available:
True, disable loop unrolling.
The integer threshold for inlining one function into another. The higher the number, the more likely that inlining will occur. This attribute is write-only.
True, allow vectorizing loops.
The general optimization level, as an integer between 0 and 3.
Whether and how much to optimize for size, as an integer between 0 and 2.
True, enable the SLP vectorizer, which uses a different algorithm than the loop vectorizer. Both may be enabled at the same time.
- class llvmlite.binding.PassManager¶
The base class for pass managers. Use individual
PassManagerBuilder.populate()to add optimization passes.
- class llvmlite.binding.ModulePassManager¶
Create a new pass manager to run optimization passes on a module.
runmethod is available:
- class llvmlite.binding.FunctionPassManager(module)¶
Create a new pass manager to run optimization passes on a function of the given module, a
The following methods are available: