llvm-tf-12.1.1: Bindings to the LLVM compiler toolkit using type families.

Safe HaskellNone
LanguageHaskell98

LLVM.Util.Optimize

Synopsis

Documentation

optimizeModule :: Int -> Module -> IO Bool Source #

Result tells whether the module was modified by any of the passes.

It is very important that you set target triple and target data layout before optimizing. Otherwise the optimizer will make wrong assumptions and e.g. corrupt your record offsets. See e.g. example/Array for how this can be achieved.

In the future I might enforce via types that you set target parameters before optimization.