Commit 727fae32 authored by Ian Lynagh's avatar Ian Lynagh

Make some more modules use LazyUniqFM instead of UniqFM

If these modules use UniqFM then we get a stack overflow when compiling
modules that use fundeps. I haven't tracked down the actual cause.
parent d6a7aff8
...@@ -35,7 +35,7 @@ module NewDemand( ...@@ -35,7 +35,7 @@ module NewDemand(
import StaticFlags import StaticFlags
import BasicTypes import BasicTypes
import VarEnv import VarEnv
import UniqFM import LazyUniqFM
import Util import Util
import Outputable import Outputable
\end{code} \end{code}
......
...@@ -46,7 +46,7 @@ module VarEnv ( ...@@ -46,7 +46,7 @@ module VarEnv (
import OccName import OccName
import Var import Var
import VarSet import VarSet
import UniqFM import LazyUniqFM
import Unique import Unique
import Util import Util
import Maybes import Maybes
......
...@@ -38,7 +38,7 @@ import CoreSyn ...@@ -38,7 +38,7 @@ import CoreSyn
import Id import Id
import IdInfo import IdInfo
import NameSet import NameSet
import UniqFM import LazyUniqFM
import Name import Name
import VarSet import VarSet
import Var import Var
......
...@@ -22,7 +22,7 @@ import IdInfo ...@@ -22,7 +22,7 @@ import IdInfo
import Type import Type
import Var import Var
import VarEnv import VarEnv
import UniqFM import LazyUniqFM
import Name hiding (tidyNameOcc) import Name hiding (tidyNameOcc)
import OccName import OccName
import SrcLoc import SrcLoc
......
...@@ -40,7 +40,7 @@ import MachOp ...@@ -40,7 +40,7 @@ import MachOp
import CLabel import CLabel
import State import State
import UniqFM import LazyUniqFM
import Unique ( Unique, getUnique ) import Unique ( Unique, getUnique )
import UniqSupply import UniqSupply
import List ( groupBy, sortBy ) import List ( groupBy, sortBy )
......
...@@ -105,7 +105,8 @@ import UniqSet ...@@ -105,7 +105,8 @@ import UniqSet
import Constants import Constants
import FastTypes import FastTypes
import FastBool import FastBool
import UniqFM import qualified UniqFM as S
import LazyUniqFM
#if powerpc_TARGET_ARCH #if powerpc_TARGET_ARCH
import Data.Word ( Word8, Word16, Word32 ) import Data.Word ( Word8, Word16, Word32 )
...@@ -518,20 +519,20 @@ worst n classN classC ...@@ -518,20 +519,20 @@ worst n classN classC
{-# INLINE regClass #-} {-# INLINE regClass #-}
trivColorable :: RegClass -> UniqSet Reg -> UniqSet Reg -> Bool trivColorable :: RegClass -> UniqSet Reg -> UniqSet Reg -> Bool
trivColorable classN conflicts exclusions trivColorable classN (MkUniqFM conflicts) (MkUniqFM exclusions)
= {-# SCC "trivColorable" #-} = {-# SCC "trivColorable" #-}
let let
{-# INLINE isSqueesed #-} {-# INLINE isSqueesed #-}
isSqueesed cI cF ufm isSqueesed cI cF ufm
= case ufm of = case ufm of
NodeUFM _ _ left right S.NodeUFM _ _ left right
-> case isSqueesed cI cF right of -> case isSqueesed cI cF right of
(# s, cI', cF' #) (# s, cI', cF' #)
-> case s of -> case s of
False -> isSqueesed cI' cF' left False -> isSqueesed cI' cF' left
True -> (# True, cI', cF' #) True -> (# True, cI', cF' #)
LeafUFM _ reg S.LeafUFM _ (Lazy reg)
-> case regClass reg of -> case regClass reg of
RcInteger RcInteger
-> case cI +# _ILIT(1) of -> case cI +# _ILIT(1) of
...@@ -541,7 +542,7 @@ trivColorable classN conflicts exclusions ...@@ -541,7 +542,7 @@ trivColorable classN conflicts exclusions
-> case cF +# _ILIT(1) of -> case cF +# _ILIT(1) of
cF' -> (# cF' >=# ALLOCATABLE_REGS_DOUBLE, cI, cF' #) cF' -> (# cF' >=# ALLOCATABLE_REGS_DOUBLE, cI, cF' #)
EmptyUFM S.EmptyUFM
-> (# False, cI, cF #) -> (# False, cI, cF #)
in case isSqueesed (_ILIT(0)) (_ILIT(0)) conflicts of in case isSqueesed (_ILIT(0)) (_ILIT(0)) conflicts of
......
...@@ -24,7 +24,7 @@ import PprMach ...@@ -24,7 +24,7 @@ import PprMach
import UniqSupply import UniqSupply
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
import Bag import Bag
import Outputable import Outputable
import DynFlags import DynFlags
......
...@@ -97,7 +97,7 @@ import Cmm hiding (RegSet) ...@@ -97,7 +97,7 @@ import Cmm hiding (RegSet)
import Digraph import Digraph
import Unique ( Uniquable(getUnique), Unique ) import Unique ( Uniquable(getUnique), Unique )
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
import UniqSupply import UniqSupply
import Outputable import Outputable
import State import State
......
...@@ -30,7 +30,7 @@ import MachInstrs ...@@ -30,7 +30,7 @@ import MachInstrs
import Cmm import Cmm
import Outputable import Outputable
import UniqFM import LazyUniqFM
import UniqSet import UniqSet
import State import State
......
...@@ -42,7 +42,7 @@ import Digraph ...@@ -42,7 +42,7 @@ import Digraph
import Outputable import Outputable
import Unique import Unique
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
import UniqSupply import UniqSupply
import Bag import Bag
import State import State
......
...@@ -23,7 +23,7 @@ import MachInstrs ...@@ -23,7 +23,7 @@ import MachInstrs
import MachRegs import MachRegs
import Cmm import Cmm
import UniqFM import LazyUniqFM
import UniqSet import UniqSet
import Outputable import Outputable
import State import State
......
...@@ -33,7 +33,7 @@ import Maybes ( orElse ) ...@@ -33,7 +33,7 @@ import Maybes ( orElse )
import Digraph ( stronglyConnCompR, SCC(..) ) import Digraph ( stronglyConnCompR, SCC(..) )
import PrelNames ( buildIdKey, foldrIdKey, runSTRepIdKey, augmentIdKey ) import PrelNames ( buildIdKey, foldrIdKey, runSTRepIdKey, augmentIdKey )
import Unique ( Unique ) import Unique ( Unique )
import UniqFM ( keysUFM, intersectUFM_C, foldUFM_Directly ) import LazyUniqFM ( keysUFM, intersectUFM_C, foldUFM_Directly )
import Util ( mapAndUnzip ) import Util ( mapAndUnzip )
import Outputable import Outputable
......
...@@ -45,7 +45,7 @@ import Var ( Var ) ...@@ -45,7 +45,7 @@ import Var ( Var )
import VarEnv import VarEnv
import TysWiredIn ( unboxedPairDataCon ) import TysWiredIn ( unboxedPairDataCon )
import TysPrim ( realWorldStatePrimTy ) import TysPrim ( realWorldStatePrimTy )
import UniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly, import LazyUniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly,
keysUFM, minusUFM, ufmToList, filterUFM ) keysUFM, minusUFM, ufmToList, filterUFM )
import Type ( isUnLiftedType, coreEqType, splitTyConApp_maybe ) import Type ( isUnLiftedType, coreEqType, splitTyConApp_maybe )
import Coercion ( coercionKind ) import Coercion ( coercionKind )
......
...@@ -40,7 +40,7 @@ import Control.Monad ...@@ -40,7 +40,7 @@ import Control.Monad
import Outputable import Outputable
import TcType import TcType
import Unique import Unique
import UniqFM import LazyUniqFM
\end{code} \end{code}
......
...@@ -14,7 +14,7 @@ module GraphBase ( ...@@ -14,7 +14,7 @@ module GraphBase (
where where
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
-- | A fn to check if a node is trivially colorable -- | A fn to check if a node is trivially colorable
......
...@@ -19,7 +19,7 @@ import GraphOps ...@@ -19,7 +19,7 @@ import GraphOps
import GraphPpr import GraphPpr
import Unique import Unique
import UniqFM import LazyUniqFM
import UniqSet import UniqSet
import Outputable import Outputable
......
...@@ -24,7 +24,7 @@ import GraphBase ...@@ -24,7 +24,7 @@ import GraphBase
import Outputable import Outputable
import Unique import Unique
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
import Data.List hiding (union) import Data.List hiding (union)
import Data.Maybe import Data.Maybe
......
...@@ -12,7 +12,7 @@ import GraphBase ...@@ -12,7 +12,7 @@ import GraphBase
import Outputable import Outputable
import Unique import Unique
import UniqSet import UniqSet
import UniqFM import LazyUniqFM
import Data.List import Data.List
import Data.Maybe import Data.Maybe
......
...@@ -13,7 +13,9 @@ Basically, the things need to be in class @Uniquable@, and we use the ...@@ -13,7 +13,9 @@ Basically, the things need to be in class @Uniquable@, and we use the
\begin{code} \begin{code}
{-# OPTIONS -Wall -fno-warn-name-shadowing -Werror -fallow-undecidable-instances #-} {-# OPTIONS -Wall -fno-warn-name-shadowing -Werror -fallow-undecidable-instances #-}
module LazyUniqFM ( module LazyUniqFM (
UniqFM, -- abstract type UniqFM(..), -- abstract type
-- XXX Not actually abstract because of nativeGen/MachRegs; sigh
Lazy(Lazy), -- XXX Also for nativeGen/MachRegs; sigh
emptyUFM, emptyUFM,
unitUFM, unitUFM,
......
...@@ -22,7 +22,7 @@ module UniqSet ( ...@@ -22,7 +22,7 @@ module UniqSet (
) where ) where
import Maybes import Maybes
import UniqFM import LazyUniqFM
import Unique import Unique
#if ! OMIT_NATIVE_CODEGEN #if ! OMIT_NATIVE_CODEGEN
......
...@@ -39,7 +39,7 @@ import TysWiredIn ...@@ -39,7 +39,7 @@ import TysWiredIn
import TysPrim ( intPrimTy ) import TysPrim ( intPrimTy )
import Unique import Unique
import UniqFM import LazyUniqFM
import UniqSet import UniqSet
import Util ( singleton ) import Util ( singleton )
import Digraph ( SCC(..), stronglyConnComp ) import Digraph ( SCC(..), stronglyConnComp )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment