Safe Haskell | None |
---|
A PassManager
holds collection of passes, to be run on Module
s.
Build one with withPassManager
:
- from a
CuratedPassSetSpec
if you want optimization but not to play with your compiler - from a [
Pass
] if you do want to play with your compiler - from a ([
Pass
],TargetLowering
) if you want to provide target-specific information (e.g. instruction costs) to the few passes that use it (see comments onPass
).
- data PassManager
- class PassManagerSpecification s
- data CuratedPassSetSpec = CuratedPassSetSpec {}
- defaultCuratedPassSetSpec :: CuratedPassSetSpec
- withPassManager :: PassManagerSpecification s => s -> (PassManager -> IO a) -> IO a
- runPassManager :: PassManager -> Module -> IO Bool
Documentation
class PassManagerSpecification s
There are different ways to get a PassManager
. This class embodies them.
data CuratedPassSetSpec
This type is a high-level specification of a set of passes. It uses the same
collection of passes chosen by the LLVM team in the command line tool opt
. The fields
of this spec are much like typical compiler command-line flags - e.g. -O<n>, etc.
defaultCuratedPassSetSpec :: CuratedPassSetSpec
Helper to make a CuratedPassSetSpec
withPassManager :: PassManagerSpecification s => s -> (PassManager -> IO a) -> IO a
bracket the creation of a PassManager
runPassManager :: PassManager -> Module -> IO Bool
run the passes in a PassManager
on a Module
, modifying the Module
.