问题
What's the difference between "ModulePassManagers", "FunctionPassManager" and "BasicBlockPassManagers" in LLVM?
And, does "FunctionPassManager" can only be used on "function" type in LLVM-IR?
回答1:
LLVM IR is subdivided into different units. The different units of LLVM IR are as follows
- Modules
- Functions
- Basic blocks
- Instructions
A module consists of functions that are in turn made up of different basic blocks that contain a sequence of instructions. The different pass managers operate on different levels on LLVM-IR. E.g the difference between them is on what abstraction level they operate.
Some useful links discussing the matter in more detail.
Passes in LLVM
About the LLVM pass manager
来源:https://stackoverflow.com/questions/50257850/whats-the-difference-between-modulepassmanagers-functionpassmanager-and-b