ddc-core-llvm-0.4.2.1: Disciplined Disciple Compiler LLVM code generator.

Safe HaskellNone
LanguageHaskell98

DDC.Llvm.Transform.Simpl

Description

LLVM program simplifier.

The LLVM compiler itself already contains a metric crapton of transforms that we don't want to re-implement here. However, these simple things are useful when normalising the code emitted by the code generator, so that the LLVM compiler will actually accept it.

Synopsis

Documentation

simpl :: Config -> Module -> Module Source

Simplify a module.

data Config Source

Simplifier config.

Constructors

Config 

Fields

configDropNops :: Bool

Drop NOP instructions.

configSimplAlias :: Bool

Inline simple v1 v2 bindings.

configSimplConst :: Bool

Inline simple v1 const bindings.

NOTE: Inlining constants into phi nodes before the from labels for each in-edge are filled will lose information and render the program uncompilable.

configSquashUndef :: Bool
 

configZero :: Config Source

Config with all transforms disabled.