import RegClass
import Reg
import GraphBase
import UniqFM
import FastTypes
32% of total compile time and 42% of total alloc when compiling SHA1.lhs from darcs.
Therefore the UniqFM is made non-abstract and we use custom fold.
MS 2010/04
When converting UniqFM to use Data.IntMap, the fold cannot use UniqFM internal
the folding if the count gets greater or equal to maxCount. We thus convert
UniqFM to a (lazy) list, do the fold and stops if necessary, which was
import CoreSyn
import CoreFVs
import CoreUtils ( exprIsTrivial, isDefaultAlt, isExpandableApp )
import Id
import Name( localiseName )
import BasicTypes
import VarSet
import VarEnv
import Var
import Demand ( argOneShots, argsOneShots )
import Maybes ( orElse )
import Digraph ( SCC(..), stronglyConnCompFromEdgedVerticesR )
import Unique
import UniqFM
import RegAlloc.Linear.State
import RegAlloc.Linear.Base
import RegAlloc.Linear.FreeRegs
import RegAlloc.Linear.Stats
import RegAlloc.Linear.JoinToTargets
import qualified RegAlloc.Linear.PPC.FreeRegs as PPC
import qualified RegAlloc.Linear.SPARC.FreeRegs as SPARC
import qualified RegAlloc.Linear.X86.FreeRegs as X86
import TargetReg
import RegAlloc.Liveness
import Instruction
import Reg
import BlockId
import OldCmm hiding (RegSet)
import Util ( lengthExceeds )
import UniqFM
import FastString
#else
import TrieMap
import CoreSubst
import Var ( Var )
import Id ( Id, idType, idInlineActivation, zapIdOccInfo )
import CoreUtils ( mkAltExpr
, exprIsTrivial, exprIsCheap )
import DataCon ( isUnboxedTupleCon )
import Type ( tyConAppArgs )
import CoreSyn
import Outputable
import LoadIface ( loadInterfaceForName, loadSrcInterface )
import IfaceEnv
import HsSyn
import RdrHsSyn ( extractHsTyRdrTyVars )
import RdrName
import HscTypes
import TcEnv ( tcLookupDataCon, tcLookupField, isBrackStage )
import TcRnMonad
import Id ( isRecordSelector )
import Name
import NameSet
import Module ( ModuleName, moduleName )
import UniqFM
import DataCon ( dataConFieldLabels )
-- plugin for GHC. So authors of plugins can probably get away simply
-- with saying "import GhcPlugins".
module VarSet, module VarEnv, module NameSet, module NameEnv,
module UniqSet, module UniqFM, module FiniteMap,
-- Plugin stuff itself
import CoreMonad
-- Variable naming
import RdrName
import OccName hiding ( varName {- conflicts with Var.varName -} )
import Name hiding ( varName {- reexport from OccName, conflicts with Var.varName -} )
import Var
import Id hiding ( lazySetIdInfo, setIdExported, setIdNotExported {- all three conflict with Var -} )
import IdInfo
-- Core
import CoreSyn
import Literal
import GraphBase
import GraphOps
import GraphPpr
import Unique
import UniqFM
import UniqSet
import Outputable
-> Int -- ^ how many times we've tried to color this graph so far.
-> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
, UniqSet k -- the set of nodes that we couldn't find a color for.
, UniqFM k ) -- map of regs (r1 -> r2) that were coaleced
, Outputable cls)
=> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
import GraphBase
import GraphOps
import GraphPpr
import Unique
import UniqFM
import UniqSet
-> Int -- ^ how many times we've tried to color this graph so far.
-> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
, UniqSet k -- the set of nodes that we couldn't find a color for.
, UniqFM k ) -- map of regs (r1 -> r2) that were coaleced
, Eq color, Outputable cls)
=> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
, Eq color, Outputable cls)
=> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
import GraphBase
import GraphOps
import GraphPpr
import Unique
import UniqFM
import UniqSet
import Data.Maybe
import Data.List
-> Int -- ^ how many times we've tried to color this graph so far.
-> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
, Eq color, Outputable cls)
=> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).
, Eq color, Outputable cls)
=> UniqFM (UniqSet color) -- ^ map of (node class -> set of colors available for this class).