|
|
|
|
|
|
Synopsis |
|
|
|
|
The IdDetails type
|
|
|
The IdDetails of an Id give stable, and necessary,
information about the Id.
| Constructors | VanillaId | | RecSelId | The Id for a record selector
| sel_tycon :: TyCon | For a data type family, this is the instance TyCon
not the family TyCon
| sel_naughty :: Bool | |
| DataConWorkId DataCon | The Id is for a data constructor worker
| DataConWrapId DataCon | The Id is for a data constructor wrapper
| ClassOpId Class | The Id is an operation of a class
| PrimOpId PrimOp | The Id is for a primitive operator
| FCallId ForeignCall | The Id is for a foreign call
| TickBoxOpId TickBoxOp | The Id is for a HPC tick box (both traditional and binary)
| DFunId | A dictionary function. We don't use this in an essential way,
currently, but it's kind of nice that we can keep track of
which Ids are DFuns, across module boundaries too
|
| Instances | |
|
|
|
|
The IdInfo type
|
|
|
An IdInfo gives optional information about an Id. If
present it never lies, but it may not be present, in which case there
is always a conservative assumption which can be made.
Two Ids may have different info even though they have the same
Unique (and are hence the same Id); for example, one might lack
the properties attached to the other.
The IdInfo gives information about the value, or definition, of the
Id. It does not contain information about the Id's usage,
except for demandInfo and lbvarInfo.
|
|
|
|
Basic IdInfo that carries no useful information whatsoever
|
|
|
More informative IdInfo we can use when we know the Id has no CAF references
|
|
|
Just evaluate the IdInfo to WHNF
|
|
|
Evaluate all the fields of the IdInfo that are generally demanded by the
compiler
|
|
Zapping various forms of Info
|
|
|
This is used to remove information on lambda binders that we have
setup as part of a lambda group, assuming they will be applied all at once,
but turn out to be part of an unsaturated lambda as in e.g:
(\x1. \x2. e) arg1
|
|
|
Remove demand info on the IdInfo if it is present, otherwise return Nothing
|
|
|
Zap info that depends on free variables
|
|
The ArityInfo type
|
|
|
An ArityInfo of n tells us that partial application of this
Id to up to n-1 value arguments does essentially no work.
That is not necessarily the same as saying that it has n leading
lambdas, because coerces may get in the way.
The arity might increase later in the compilation process, if
an extra lambda floats up to the binding site.
|
|
|
It is always safe to assume that an Id has an arity of 0
|
|
|
Id arity
|
|
|
|
|
|
Demand and strictness Info
|
|
|
Id strictness information. Reason for Maybe:
the DmdAnal phase needs to know whether
this is the first visit, so it can assign botSig.
Other customers want topSig. So Nothing is good.
|
|
|
|
|
Id demand information. Similarly we want to know
if there's no known demand yet, for when we are looking
for CPR info
|
|
|
|
|
|
|
Set old and new strictness information together
|
|
The WorkerInfo type
|
|
|
If this Id has a worker then we store a reference to it. Worker
functions are generated by the worker/wrapper pass, using information
information from strictness analysis.
| Constructors | NoWorker | No known worker function
| HasWorker Id Arity | The Arity is the arity of the wrapper at the moment of the
worker/wrapper split, which may be different from the current Id Aritiy
|
|
|
|
|
|
|
The Arity of the worker function at the time of the split if it exists, or a panic otherwise
|
|
|
The Id of the worker function if it exists, or a panic otherwise
|
|
|
Pointer to worker function.
Within one module this is irrelevant; the
inlining of a worker is handled via the Unfolding.
However, when the module is imported by others, the
WorkerInfo is used only to indicate the form of
the RHS, so that interface files don't actually
need to contain the RHS; it can be derived from
the strictness info
|
|
|
|
|
|
Unfolding Info
|
|
|
The Ids unfolding
|
|
|
|
|
|
The InlinePragInfo type
|
|
|
Tells when the inlining is active.
When it is active the thing may be inlined, depending on how
big it is.
If there was an INLINE pragma, then as a separate matter, the
RHS will have been made to look small with a Core inline Note
The default InlinePragInfo is AlwaysActive, so the info serves
entirely as a way to inhibit inlining until we want it
|
|
|
Any inline pragma atached to the Id
|
|
|
|
The OccInfo type
|
|
|
Identifier occurrence information
| Constructors | NoOccInfo | There are many occurrences, or unknown occurences
| IAmDead | Marks unused variables. Sometimes useful for
lambda and case-bound variables.
| OneOcc !InsideLam !OneBranch !InterestingCxt | Occurs exactly once, not inside a rule
| IAmALoopBreaker !RulesOnly | This identifier breaks a loop of mutually recursive functions. The field
marks whether it is only a loop breaker due to a reference in a rule
|
| Instances | |
|
|
|
|
|
|
|
|
|
How the Id occurs in the program
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The SpecInfo type
|
|
|
Records the specializations of this Id that we know about
in the form of rewrite CoreRules that target them
| Constructors | |
|
|
|
|
|
Retrieve the locally-defined free variables of both the left and
right hand sides of the specialization rules
|
|
|
|
|
|
|
Change the name of the function the rule is keyed on on all of the CoreRules
|
|
|
Specialisations of the Ids function which exist
|
|
|
|
The CAFInfo type
|
|
|
Records whether an Id makes Constant Applicative Form references
| Constructors | MayHaveCafRefs | Indicates that the Id is for either:
1. A function or static constructor
that refers to one or more CAFs, or
2. A real live CAF
| NoCafRefs | A function or static constructor
that refers to no CAFs.
|
| Instances | |
|
|
|
|
|
|
|
Id CAF info
|
|
|
|
The LBVarInfo type
|
|
|
If the Id is a lambda-bound variable then it may have lambda-bound
variable info. Sometimes we know whether the lambda binding this variable
is a "one-shot" lambda; that is, whether it is applied at most once.
This information may be useful in optimisation, as computations may
safely be floated inside such a lambda without risk of duplicating
work.
| Constructors | NoLBVarInfo | No information
| IsOneShotLambda | The lambda is applied at most once).
|
| Instances | |
|
|
|
It is always safe to assume that an Id has no lambda-bound variable information
|
|
|
|
|
Info about a lambda-bound variable, if the Id is one
|
|
|
|
Tick-box Info
|
|
|
Tick box for Hpc-style coverage
| Constructors | | Instances | |
|
|
|
|
Produced by Haddock version 2.6.1 |