diff --git a/compiler/basicTypes/NewDemand.lhs b/compiler/basicTypes/NewDemand.lhs index 062e25ff3097729c624c1592d7d8111401684ab6..23619720371155bc67a31b46d74d9b0742b99d79 100644 --- a/compiler/basicTypes/NewDemand.lhs +++ b/compiler/basicTypes/NewDemand.lhs @@ -35,7 +35,7 @@ module NewDemand( import StaticFlags import BasicTypes import VarEnv -import UniqFM +import LazyUniqFM import Util import Outputable \end{code} diff --git a/compiler/basicTypes/VarEnv.lhs b/compiler/basicTypes/VarEnv.lhs index 3b0be0bebf4ae922f2de87e7b5a17876f8955841..dbef903de852825210ff70f8b7906419530b6fc8 100644 --- a/compiler/basicTypes/VarEnv.lhs +++ b/compiler/basicTypes/VarEnv.lhs @@ -46,7 +46,7 @@ module VarEnv ( import OccName import Var import VarSet -import UniqFM +import LazyUniqFM import Unique import Util import Maybes diff --git a/compiler/coreSyn/CoreFVs.lhs b/compiler/coreSyn/CoreFVs.lhs index 57316c7211fa77a3c6fb159b523bd25da3db6fb1..199cc694c732bc549c7a6f0c18b7ea2af0978adb 100644 --- a/compiler/coreSyn/CoreFVs.lhs +++ b/compiler/coreSyn/CoreFVs.lhs @@ -38,7 +38,7 @@ import CoreSyn import Id import IdInfo import NameSet -import UniqFM +import LazyUniqFM import Name import VarSet import Var diff --git a/compiler/coreSyn/CoreTidy.lhs b/compiler/coreSyn/CoreTidy.lhs index 5acee51f429cd2a4102679d5fe5ecdd8703d78f8..4da1dc33502bacef77b6abb6778dcdb1f5f9c091 100644 --- a/compiler/coreSyn/CoreTidy.lhs +++ b/compiler/coreSyn/CoreTidy.lhs @@ -22,7 +22,7 @@ import IdInfo import Type import Var import VarEnv -import UniqFM +import LazyUniqFM import Name hiding (tidyNameOcc) import OccName import SrcLoc diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index 6d3bf7ca75cf5f222fea0579aadd0227ad6f3eba..e0608cb80cd398c572deb3b9aec93f478847209b 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -40,7 +40,7 @@ import MachOp import CLabel import State -import UniqFM +import LazyUniqFM import Unique ( Unique, getUnique ) import UniqSupply import List ( groupBy, sortBy ) diff --git a/compiler/nativeGen/MachRegs.lhs b/compiler/nativeGen/MachRegs.lhs index 85c88b2ed3b489923434fc12cf0ccea251ad9e56..0174fac0ceea60ed02aae57a394ccaaf4acb2836 100644 --- a/compiler/nativeGen/MachRegs.lhs +++ b/compiler/nativeGen/MachRegs.lhs @@ -105,7 +105,8 @@ import UniqSet import Constants import FastTypes import FastBool -import UniqFM +import qualified UniqFM as S +import LazyUniqFM #if powerpc_TARGET_ARCH import Data.Word ( Word8, Word16, Word32 ) @@ -518,20 +519,20 @@ worst n classN classC {-# INLINE regClass #-} trivColorable :: RegClass -> UniqSet Reg -> UniqSet Reg -> Bool -trivColorable classN conflicts exclusions +trivColorable classN (MkUniqFM conflicts) (MkUniqFM exclusions) = {-# SCC "trivColorable" #-} let {-# INLINE isSqueesed #-} isSqueesed cI cF ufm = case ufm of - NodeUFM _ _ left right + S.NodeUFM _ _ left right -> case isSqueesed cI cF right of (# s, cI', cF' #) -> case s of False -> isSqueesed cI' cF' left True -> (# True, cI', cF' #) - LeafUFM _ reg + S.LeafUFM _ (Lazy reg) -> case regClass reg of RcInteger -> case cI +# _ILIT(1) of @@ -541,7 +542,7 @@ trivColorable classN conflicts exclusions -> case cF +# _ILIT(1) of cF' -> (# cF' >=# ALLOCATABLE_REGS_DOUBLE, cI, cF' #) - EmptyUFM + S.EmptyUFM -> (# False, cI, cF #) in case isSqueesed (_ILIT(0)) (_ILIT(0)) conflicts of diff --git a/compiler/nativeGen/RegAllocColor.hs b/compiler/nativeGen/RegAllocColor.hs index 51a0bffbc6c9f7efa4c6e8ff05497e202182bd17..e2e002af3516d811e076462543a9fb15081ef062 100644 --- a/compiler/nativeGen/RegAllocColor.hs +++ b/compiler/nativeGen/RegAllocColor.hs @@ -24,7 +24,7 @@ import PprMach import UniqSupply import UniqSet -import UniqFM +import LazyUniqFM import Bag import Outputable import DynFlags diff --git a/compiler/nativeGen/RegAllocLinear.hs b/compiler/nativeGen/RegAllocLinear.hs index e6491b77ee9a15cdbc437d30e2067c47a5695530..b333c68d5d4aa4447d9aa4831301b3dbe90f174a 100644 --- a/compiler/nativeGen/RegAllocLinear.hs +++ b/compiler/nativeGen/RegAllocLinear.hs @@ -97,7 +97,7 @@ import Cmm hiding (RegSet) import Digraph import Unique ( Uniquable(getUnique), Unique ) import UniqSet -import UniqFM +import LazyUniqFM import UniqSupply import Outputable import State diff --git a/compiler/nativeGen/RegAllocStats.hs b/compiler/nativeGen/RegAllocStats.hs index 8eb86605ab886500685231fb5d5c8d2ed51edd8b..9f8415f5186eb799fea553ce2480f705020f477e 100644 --- a/compiler/nativeGen/RegAllocStats.hs +++ b/compiler/nativeGen/RegAllocStats.hs @@ -30,7 +30,7 @@ import MachInstrs import Cmm import Outputable -import UniqFM +import LazyUniqFM import UniqSet import State diff --git a/compiler/nativeGen/RegLiveness.hs b/compiler/nativeGen/RegLiveness.hs index 9ee98971baf49e320983970c1a357f8b4dda386f..6f21db8b77d450bf274b523975447192ef2bea9e 100644 --- a/compiler/nativeGen/RegLiveness.hs +++ b/compiler/nativeGen/RegLiveness.hs @@ -42,7 +42,7 @@ import Digraph import Outputable import Unique import UniqSet -import UniqFM +import LazyUniqFM import UniqSupply import Bag import State diff --git a/compiler/nativeGen/RegSpillCost.hs b/compiler/nativeGen/RegSpillCost.hs index d987937102570cac45d66d069e1c232aa33087c8..b49273823845659e03c26741607e1292500858cc 100644 --- a/compiler/nativeGen/RegSpillCost.hs +++ b/compiler/nativeGen/RegSpillCost.hs @@ -23,7 +23,7 @@ import MachInstrs import MachRegs import Cmm -import UniqFM +import LazyUniqFM import UniqSet import Outputable import State diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs index bdf38ee406c45d5cd709c71e1cd11320690cdfa0..efc51ba6a9d00aae6b2e5d871b25f719d1518ae3 100644 --- a/compiler/simplCore/OccurAnal.lhs +++ b/compiler/simplCore/OccurAnal.lhs @@ -33,7 +33,7 @@ import Maybes ( orElse ) import Digraph ( stronglyConnCompR, SCC(..) ) import PrelNames ( buildIdKey, foldrIdKey, runSTRepIdKey, augmentIdKey ) import Unique ( Unique ) -import UniqFM ( keysUFM, intersectUFM_C, foldUFM_Directly ) +import LazyUniqFM ( keysUFM, intersectUFM_C, foldUFM_Directly ) import Util ( mapAndUnzip ) import Outputable diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs index eec165a1a06591aab32d7e0cd55ae83087e4b305..84c2968b117c118ca02b2fddd0db194dc90d3739 100644 --- a/compiler/stranal/DmdAnal.lhs +++ b/compiler/stranal/DmdAnal.lhs @@ -45,7 +45,7 @@ import Var ( Var ) import VarEnv import TysWiredIn ( unboxedPairDataCon ) import TysPrim ( realWorldStatePrimTy ) -import UniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly, +import LazyUniqFM ( plusUFM_C, addToUFM_Directly, lookupUFM_Directly, keysUFM, minusUFM, ufmToList, filterUFM ) import Type ( isUnLiftedType, coreEqType, splitTyConApp_maybe ) import Coercion ( coercionKind ) diff --git a/compiler/typecheck/TcGadt.lhs b/compiler/typecheck/TcGadt.lhs index b556e89e3273ed15e45c2ad32e4d8479f7979933..b3156ed747a9643ec097da4e7dcc99e630e4974f 100644 --- a/compiler/typecheck/TcGadt.lhs +++ b/compiler/typecheck/TcGadt.lhs @@ -40,7 +40,7 @@ import Control.Monad import Outputable import TcType import Unique -import UniqFM +import LazyUniqFM \end{code} diff --git a/compiler/utils/GraphBase.hs b/compiler/utils/GraphBase.hs index 04eda9612013f94f35b2fe547e2e0caf91fec061..3948c81a6ab2f0644e3d7fe2a4288e30beb7a187 100644 --- a/compiler/utils/GraphBase.hs +++ b/compiler/utils/GraphBase.hs @@ -14,7 +14,7 @@ module GraphBase ( where import UniqSet -import UniqFM +import LazyUniqFM -- | A fn to check if a node is trivially colorable diff --git a/compiler/utils/GraphColor.hs b/compiler/utils/GraphColor.hs index 8e7989dc8cd25dad20af42700c4d751aa3bfde0e..e381fbf7f65f57c85a52425a4028e13de8306c27 100644 --- a/compiler/utils/GraphColor.hs +++ b/compiler/utils/GraphColor.hs @@ -19,7 +19,7 @@ import GraphOps import GraphPpr import Unique -import UniqFM +import LazyUniqFM import UniqSet import Outputable diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs index 880f3c65cd85983b1261e683309528ff32cdc9f0..a82ff686290f4a84c9b37b02e96ede5ff7d10e36 100644 --- a/compiler/utils/GraphOps.hs +++ b/compiler/utils/GraphOps.hs @@ -24,7 +24,7 @@ import GraphBase import Outputable import Unique import UniqSet -import UniqFM +import LazyUniqFM import Data.List hiding (union) import Data.Maybe diff --git a/compiler/utils/GraphPpr.hs b/compiler/utils/GraphPpr.hs index 1df5158dc22f5db24ca159d0751d01796c697a7e..0e82b319ebbfa0211d7589cec4593f2a860ef3fe 100644 --- a/compiler/utils/GraphPpr.hs +++ b/compiler/utils/GraphPpr.hs @@ -12,7 +12,7 @@ import GraphBase import Outputable import Unique import UniqSet -import UniqFM +import LazyUniqFM import Data.List import Data.Maybe diff --git a/compiler/utils/LazyUniqFM.lhs b/compiler/utils/LazyUniqFM.lhs index d8132e3cd5b11887a1efc0f20ef50347c2df7128..b7ac15d2a18a736080dcb40a7805c55a6495678e 100644 --- a/compiler/utils/LazyUniqFM.lhs +++ b/compiler/utils/LazyUniqFM.lhs @@ -13,7 +13,9 @@ Basically, the things need to be in class @Uniquable@, and we use the \begin{code} {-# OPTIONS -Wall -fno-warn-name-shadowing -Werror -fallow-undecidable-instances #-} 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, unitUFM, diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs index 08d35758a58c8260d2dd2264cf59506f2fcc4fdb..ba312dd1987c3727f58f4fcb36ff62cb235e5028 100644 --- a/compiler/utils/UniqSet.lhs +++ b/compiler/utils/UniqSet.lhs @@ -22,7 +22,7 @@ module UniqSet ( ) where import Maybes -import UniqFM +import LazyUniqFM import Unique #if ! OMIT_NATIVE_CODEGEN diff --git a/compiler/vectorise/VectType.hs b/compiler/vectorise/VectType.hs index 86dcaf236b3e5b93449e2f51947aaadae2e3cdb2..972aca1b7b9cc4842bfed33a1025d80242bd9fa0 100644 --- a/compiler/vectorise/VectType.hs +++ b/compiler/vectorise/VectType.hs @@ -39,7 +39,7 @@ import TysWiredIn import TysPrim ( intPrimTy ) import Unique -import UniqFM +import LazyUniqFM import UniqSet import Util ( singleton ) import Digraph ( SCC(..), stronglyConnComp )