llvm-analysis-0.3.0: A Haskell library for analyzing LLVM bitcode

Safe HaskellNone

LLVM.Analysis.Dominance

Contents

Description

Tools to compute dominance information for functions. Includes postdominators.

A node m postdominates a node n iff every path from n to exit passes through m.

This implementation is based on the dominator implementation in fgl, which is based on the algorithm from Cooper, Harvey, and Kennedy:

http:www.cs.rice.edu~keithEmbed/dom.pdf

Synopsis

Types

data PostdominatorTree Source

Instances

HasFunction PostdominatorTree 
ToGraphviz PostdominatorTree 
HasCFG PostdominatorTree 
HasPostdomTree PostdominatorTree 
HasCDG PostdominatorTree

Warning, this is an expensive instance to invoke as it constructs the CDG.

class HasDomTree a whereSource

Instances

HasDomTree CFG

Note, this instance constructs the dominator tree and could be expensive

HasDomTree DominatorTree 

class HasPostdomTree a whereSource

Instances

HasPostdomTree CFG

Note that this instance constructs the postdominator tree from scratch.

HasPostdomTree PostdominatorTree 
HasPostdomTree CDG 

Constructors

dominatorTree :: HasCFG cfg => cfg -> DominatorTreeSource

Construct a DominatorTree from something that behaves like a control flow graph.

postdominatorTree :: HasCFG f => f -> PostdominatorTreeSource

Construct a PostdominatorTree from something that behaves like a control flow graph.

Queries

dominates :: HasDomTree t => t -> Instruction -> Instruction -> BoolSource

Check whether n dominates m

dominators :: HasDomTree t => t -> [(Instruction, [Instruction])]Source

dominatorsFor :: HasDomTree t => t -> Instruction -> [Instruction]Source

immediateDominatorFor :: HasDomTree t => t -> Instruction -> Maybe InstructionSource

immediateDominators :: HasDomTree t => t -> [(Instruction, Instruction)]Source

postdominates :: HasPostdomTree t => t -> Instruction -> Instruction -> BoolSource

Tests whether or not an Instruction n postdominates Instruction m

postdominators :: HasPostdomTree t => t -> [(Instruction, [Instruction])]Source

postdominatorsFor :: HasPostdomTree t => t -> Instruction -> [Instruction]Source

immediatePostdominatorFor :: HasPostdomTree t => t -> Instruction -> Maybe InstructionSource

immediatePostdominators :: HasPostdomTree t => t -> [(Instruction, Instruction)]Source