ghc-7.8.0.20140228: The GHC API

Safe HaskellNone
LanguageHaskell98

CmmUtils

Contents

Synopsis

Documentation

cmmIndex :: DynFlags -> Width -> CmmExpr -> Int -> CmmExpr Source

Useful for creating an index into an array, with a staticaly known offset. The type is the element type; used for making the multiplier

cmmIndexExpr :: DynFlags -> Width -> CmmExpr -> CmmExpr -> CmmExpr Source

Useful for creating an index into an array, with an unknown offset.

Operations that probably don't belong here

toBlockListEntryFirst :: CmmGraph -> [CmmBlock] Source

like toBlockList, but the entry block always comes first

toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock] Source

Like toBlockListEntryFirst, but we strive to ensure that we order blocks so that the false case of a conditional jumps to the next block in the output list of blocks. This matches the way OldCmm blocks were output since in OldCmm the false case was a fallthrough, whereas in Cmm conditional branches have both true and false successors. Block ordering can make a big difference in performance in the LLVM backend. Note that we rely crucially on the order of successors returned for CmmCondBranch by the NonLocal instance for CmmNode defind in cmm/CmmNode.hs. -GBM

foldGraphBlocks :: (CmmBlock -> a -> a) -> a -> CmmGraph -> a Source

mapGraphNodes1 :: (forall e x. CmmNode e x -> CmmNode e x) -> CmmGraph -> CmmGraph Source