ghc-lib-0.20210601: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

GHC.Core.Opt.WorkWrap.Utils

Synopsis

Documentation

mkWwBodies :: WwOpts -> VarSet -> Id -> [Demand] -> Cpr -> UniqSM (Maybe WwResult) Source #

mkWWstr :: WwOpts -> ArgOfInlineableFun -> [Var] -> UniqSM (Bool, [Var], CoreExpr -> CoreExpr, CoreExpr -> CoreExpr) Source #

mkWorkerArgs :: Id -> Bool -> [Var] -> Type -> ([Var], [Var]) Source #

data DataConPatContext Source #

The information needed to build a pattern for a DataCon to be unboxed. The pattern can be generated from dcpc_dc and dcpc_tc_args via dataConRepInstPat. The coercion dcpc_co is for newtype wrappers.

If we get DataConPatContext dc tys co for some type ty and dataConRepInstPat ... dc tys = (exs, flds), then

  • dc exs flds :: T tys@
  • co :: T tys ~ ty

Constructors

DataConPatContext 

data UnboxingDecision s Source #

Describes the outer shape of an argument to be unboxed or left as-is Depending on how s is instantiated (e.g., Demand or Cpr).

Constructors

StopUnboxing

We ran out of strictness info. Leave untouched.

DropAbsent

The argument/field was absent. Drop it.

Unbox !DataConPatContext [s]

The argument is used strictly or the returned product was constructed, so unbox it. The DataConPatContext carries the bits necessary for instantiation with dataConRepInstPat. The [s] carries the bits of information with which we can continue unboxing, e.g. s will be Demand or Cpr.

data ArgOfInlineableFun Source #

A specialised Bool for an argument to wantToUnboxArg. See Note [Do not unpack class dictionaries].

Constructors

NotArgOfInlineableFun

Definitely not in an inlineable fun.

MaybeArgOfInlineableFun

We might be in an inlineable fun, so we won't unbox dictionary args.

wantToUnboxArg :: FamInstEnvs -> ArgOfInlineableFun -> Type -> Demand -> UnboxingDecision Demand Source #

Unboxing strategy for strict arguments.