- = IdInfo
- ArityInfo -- Its arity
-
- DemandInfo -- Whether or not it is definitely
- -- demanded
-
- SpecEnv
- -- Specialisations of this function which exist
-
- (StrictnessInfo Id)
- -- Strictness properties, notably
- -- how to conjure up "worker" functions
-
- Unfolding
- -- Its unfolding; for locally-defined
- -- things, this can *only* be NoUnfolding
-
- UpdateInfo -- Which args should be updated
-
- DeforestInfo -- Whether its definition should be
- -- unfolded during deforestation
-
- ArgUsageInfo -- how this Id uses its arguments
-
- FBTypeInfo -- the Foldr/Build W/W property of this function.
+ = IdInfo {
+ arityInfo :: ArityInfo, -- Its arity
+ demandInfo :: Demand.Demand, -- Whether or not it is definitely demanded
+ specInfo :: CoreRules, -- Specialisations of this function which exist
+ tyGenInfo :: TyGenInfo, -- Restrictions on usage-generalisation of this Id
+ strictnessInfo :: StrictnessInfo, -- Strictness properties
+ workerInfo :: WorkerInfo, -- Pointer to Worker Function
+ unfoldingInfo :: Unfolding, -- Its unfolding
+ cgInfo :: CgInfo, -- Code generator info (arity, CAF info)
+ cprInfo :: CprInfo, -- Function always constructs a product result
+ lbvarInfo :: LBVarInfo, -- Info about a lambda-bound variable
+ inlinePragInfo :: InlinePragInfo, -- Inline pragma
+ occInfo :: OccInfo, -- How it occurs
+
+ newStrictnessInfo :: Maybe StrictSig, -- Reason for Maybe: the DmdAnal phase needs to
+ -- know whether whether this is the first visit,
+ -- so it can assign botSig. Other customers want
+ -- topSig. So Nothing is good.
+ newDemandInfo :: Demand
+ }
+
+seqIdInfo :: IdInfo -> ()
+seqIdInfo (IdInfo {}) = ()
+
+megaSeqIdInfo :: IdInfo -> ()
+megaSeqIdInfo info
+ = seqArity (arityInfo info) `seq`
+ seqDemand (demandInfo info) `seq`
+ seqRules (specInfo info) `seq`
+ seqTyGenInfo (tyGenInfo info) `seq`
+ seqStrictnessInfo (strictnessInfo info) `seq`
+ seqWorker (workerInfo info) `seq`
+
+-- seqUnfolding (unfoldingInfo info) `seq`
+-- Omitting this improves runtimes a little, presumably because
+-- some unfoldings are not calculated at all
+
+-- CgInfo is involved in a loop, so we have to be careful not to seq it
+-- too early.
+-- seqCg (cgInfo info) `seq`
+ seqCpr (cprInfo info) `seq`
+ seqLBVar (lbvarInfo info) `seq`
+ seqOccInfo (occInfo info)