Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

5 changed files:

Changes:

  • compiler/GHC/CmmToAsm/AArch64/RegInfo.hs
    ... ... @@ -8,7 +8,7 @@ import GHC.Cmm
    8 8
     
    
    9 9
     import GHC.Utils.Outputable
    
    10 10
     
    
    11
    -data JumpDest = DestBlockId BlockId
    
    11
    +newtype JumpDest = DestBlockId BlockId
    
    12 12
     
    
    13 13
     -- Debug Instance
    
    14 14
     instance Outputable JumpDest where
    

  • compiler/GHC/CmmToAsm/PPC/RegInfo.hs
    ... ... @@ -27,7 +27,7 @@ import GHC.Cmm.CLabel
    27 27
     import GHC.Types.Unique
    
    28 28
     import GHC.Utils.Outputable (ppr, text, Outputable, (<>))
    
    29 29
     
    
    30
    -data JumpDest = DestBlockId BlockId
    
    30
    +newtype JumpDest = DestBlockId BlockId
    
    31 31
     
    
    32 32
     -- Debug Instance
    
    33 33
     instance Outputable JumpDest where
    

  • compiler/GHC/Core/Map/Type.hs
    ... ... @@ -554,7 +554,7 @@ instance Eq (DeBruijn a) => Eq (DeBruijn (Maybe a)) where
    554 554
     -- We also need to do the same for multiplicity! Which, since multiplicities are
    
    555 555
     -- encoded simply as a 'Type', amounts to have a Trie for a pair of types. Tries
    
    556 556
     -- of pairs are composition.
    
    557
    -data BndrMap a = BndrMap (TypeMapG (MaybeMap TypeMapG a))
    
    557
    +newtype BndrMap a = BndrMap (TypeMapG (MaybeMap TypeMapG a))
    
    558 558
     
    
    559 559
     -- TODO(22292): derive
    
    560 560
     instance Functor BndrMap where
    

  • compiler/GHC/Driver/LlvmConfigCache.hs
    ... ... @@ -18,6 +18,8 @@ import System.IO.Unsafe
    18 18
     -- Currently implemented with unsafe lazy IO. But it could be implemented with
    
    19 19
     -- an IORef as the exposed interface is in IO.
    
    20 20
     data LlvmConfigCache = LlvmConfigCache LlvmConfig
    
    21
    +-- NB: It is crucial for this to be a datatype, not a newtype.
    
    22
    +-- Allocations can increase across the board over 20% otherwise (see the discussion on !10708 and non-final pipelines)
    
    21 23
     
    
    22 24
     initLlvmConfigCache :: FilePath -> IO LlvmConfigCache
    
    23 25
     initLlvmConfigCache top_dir = pure $ LlvmConfigCache (unsafePerformIO $ initLlvmConfig top_dir)
    

  • compiler/GHC/Driver/Pipeline/Phases.hs
    ... ... @@ -52,4 +52,4 @@ data TPhase res where
    52 52
       T_MergeForeign :: PipeEnv -> HscEnv -> FilePath -> [FilePath] -> TPhase FilePath
    
    53 53
     
    
    54 54
     -- | A wrapper around the interpretation function for phases.
    
    55
    -data PhaseHook = PhaseHook (forall a . TPhase a -> IO a)
    55
    +newtype PhaseHook = PhaseHook (forall a . TPhase a -> IO a)