Safe Haskell | Ignore |
---|---|
Language | GHC2021 |
Types for the Constructed Product Result lattice.
GHC.Core.Opt.CprAnal and GHC.Core.Opt.WorkWrap.Utils
are its primary customers via idCprSig
.
Synopsis
- data Cpr where
- topCpr :: Cpr
- botCpr :: Cpr
- flatConCpr :: ConTag -> Cpr
- asConCpr :: Cpr -> Maybe (ConTag, [Cpr])
- data CprType = CprType {}
- topCprType :: CprType
- botCprType :: CprType
- flatConCprType :: ConTag -> CprType
- lubCprType :: CprType -> CprType -> CprType
- applyCprTy :: CprType -> Arity -> CprType
- abstractCprTy :: CprType -> CprType
- trimCprTy :: CprType -> CprType
- data UnpackConFieldsResult
- = AllFieldsSame !Cpr
- | ForeachField ![Cpr]
- unpackConFieldsCpr :: DataCon -> Cpr -> UnpackConFieldsResult
- newtype CprSig = CprSig {}
- topCprSig :: CprSig
- isTopCprSig :: CprSig -> Bool
- mkCprSigForArity :: Arity -> CprType -> CprSig
- mkCprSig :: Arity -> Cpr -> CprSig
- seqCprSig :: CprSig -> ()
- prependArgsCprSig :: Arity -> CprSig -> CprSig
Documentation
flatConCpr :: ConTag -> Cpr Source #
The abstract domain \(A_t\) from the original 'CPR for Haskell' paper.
topCprType :: CprType Source #
botCprType :: CprType Source #
flatConCprType :: ConTag -> CprType Source #
abstractCprTy :: CprType -> CprType Source #
data UnpackConFieldsResult Source #
The result of unpackConFieldsCpr
.
unpackConFieldsCpr :: DataCon -> Cpr -> UnpackConFieldsResult Source #
Unpacks a ConCpr
-shaped Cpr
and returns the field Cpr
s wrapped in a
ForeachField
. Otherwise, it returns AllFieldsSame
with the appropriate
Cpr
to assume for each field.
The use of UnpackConFieldsResult
allows O(1) space for the common,
non-ConCpr
case.
The arity of the wrapped CprType
is the arity at which it is safe
to unleash. See Note [Understanding DmdType and DmdSig] in GHC.Types.Demand
isTopCprSig :: CprSig -> Bool Source #
mkCprSigForArity :: Arity -> CprType -> CprSig Source #
Turns a CprType
computed for the particular Arity
into a CprSig
unleashable at that arity. See Note [Understanding DmdType and DmdSig] in
GHC.Types.Demand