2 % (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
4 \section[IdInfo]{@IdInfos@: Non-essential information about @Ids@}
6 (And a pretty good illustration of quite a few things wrong with
11 GlobalIdDetails(..), notGlobalId, -- Not abstract
14 vanillaIdInfo, noCafNoTyGenIdInfo,
15 seqIdInfo, megaSeqIdInfo,
18 zapLamInfo, zapDemandInfo,
19 shortableIdInfo, copyIdInfo,
23 exactArity, atLeastArity, unknownArity, hasArity,
24 arityInfo, setArityInfo, ppArityInfo, arityLowerBound,
26 -- Strictness; imported from Demand
28 mkStrictnessInfo, noStrictnessInfo,
29 ppStrictnessInfo,isBottomingStrictness,
30 strictnessInfo, setStrictnessInfo,
32 -- Usage generalisation
34 tyGenInfo, setTyGenInfo,
35 noTyGenInfo, isNoTyGenInfo, ppTyGenInfo, tyGenInfoString,
38 WorkerInfo(..), workerExists, wrapperArity, workerId,
39 workerInfo, setWorkerInfo, ppWorkerInfo,
42 unfoldingInfo, setUnfoldingInfo,
45 demandInfo, setDemandInfo,
49 inlinePragInfo, setInlinePragInfo, pprInlinePragInfo,
50 isNeverInlinePrag, neverInlinePrag,
53 OccInfo(..), isFragileOcc, isDeadOcc, isLoopBreaker,
54 InsideLam, OneBranch, insideLam, notInsideLam, oneBranch, notOneBranch,
58 specInfo, setSpecInfo,
61 CgInfo(..), cgInfo, setCgInfo, cgMayHaveCafRefs, pprCgInfo,
62 cgArity, cgCafInfo, vanillaCgInfo,
63 CgInfoEnv, lookupCgInfo,
67 CafInfo(..), ppCafInfo, setCafInfo, mayHaveCafRefs,
69 -- Constructed Product Result Info
70 CprInfo(..), cprInfo, setCprInfo, ppCprInfo, noCprInfo,
72 -- Lambda-bound variable info
73 LBVarInfo(..), lbvarInfo, setLBVarInfo, noLBVarInfo, hasNoLBVarInfo
76 #include "HsVersions.h"
80 import Type ( Type, usOnce, eqUsage )
81 import PrimOp ( PrimOp )
82 import NameEnv ( NameEnv, lookupNameEnv )
85 import BasicTypes ( OccInfo(..), isFragileOcc, isDeadOcc, seqOccInfo, isLoopBreaker,
86 InsideLam, insideLam, notInsideLam,
87 OneBranch, oneBranch, notOneBranch,
90 import DataCon ( DataCon )
91 import ForeignCall ( ForeignCall )
92 import FieldLabel ( FieldLabel )
93 import Type ( usOnce, usMany )
94 import Demand -- Lots of stuff
96 import Util ( seqList )
98 infixl 1 `setDemandInfo`,
112 -- infixl so you can say (id `set` a `set` b)
115 %************************************************************************
117 \subsection{GlobalIdDetails
119 %************************************************************************
121 This type is here (rather than in Id.lhs) mainly because there's
122 an IdInfo.hi-boot, but no Id.hi-boot, and GlobalIdDetails is imported
123 (recursively) by Var.lhs.
127 = VanillaGlobal -- Imported from elsewhere, a default method Id.
129 | RecordSelId FieldLabel -- The Id for a record selector
130 | DataConId DataCon -- The Id for a data constructor *worker*
131 | DataConWrapId DataCon -- The Id for a data constructor *wrapper*
132 -- [the only reasons we need to know is so that
133 -- a) we can suppress printing a definition in the interface file
134 -- b) when typechecking a pattern we can get from the
135 -- Id back to the data con]
137 | PrimOpId PrimOp -- The Id for a primitive operator
138 | FCallId ForeignCall -- The Id for a foreign call
140 | NotGlobalId -- Used as a convenient extra return value from globalIdDetails
142 notGlobalId = NotGlobalId
144 instance Outputable GlobalIdDetails where
145 ppr NotGlobalId = ptext SLIT("[***NotGlobalId***]")
146 ppr VanillaGlobal = ptext SLIT("[GlobalId]")
147 ppr (DataConId _) = ptext SLIT("[DataCon]")
148 ppr (DataConWrapId _) = ptext SLIT("[DataConWrapper]")
149 ppr (PrimOpId _) = ptext SLIT("[PrimOp]")
150 ppr (FCallId _) = ptext SLIT("[ForeignCall]")
151 ppr (RecordSelId _) = ptext SLIT("[RecSel]")
155 %************************************************************************
157 \subsection{The main IdInfo type}
159 %************************************************************************
161 An @IdInfo@ gives {\em optional} information about an @Id@. If
162 present it never lies, but it may not be present, in which case there
163 is always a conservative assumption which can be made.
165 Two @Id@s may have different info even though they have the same
166 @Unique@ (and are hence the same @Id@); for example, one might lack
167 the properties attached to the other.
169 The @IdInfo@ gives information about the value, or definition, of the
170 @Id@. It does {\em not} contain information about the @Id@'s usage
171 (except for @DemandInfo@? ToDo). (@lbvarInfo@ is also a marginal
177 arityInfo :: ArityInfo, -- Its arity
178 demandInfo :: Demand, -- Whether or not it is definitely demanded
179 specInfo :: CoreRules, -- Specialisations of this function which exist
180 tyGenInfo :: TyGenInfo, -- Restrictions on usage-generalisation of this Id
181 strictnessInfo :: StrictnessInfo, -- Strictness properties
182 workerInfo :: WorkerInfo, -- Pointer to Worker Function
183 unfoldingInfo :: Unfolding, -- Its unfolding
184 cgInfo :: CgInfo, -- Code generator info (arity, CAF info)
185 cprInfo :: CprInfo, -- Function always constructs a product result
186 lbvarInfo :: LBVarInfo, -- Info about a lambda-bound variable
187 inlinePragInfo :: InlinePragInfo, -- Inline pragma
188 occInfo :: OccInfo -- How it occurs
191 seqIdInfo :: IdInfo -> ()
192 seqIdInfo (IdInfo {}) = ()
194 megaSeqIdInfo :: IdInfo -> ()
196 = seqArity (arityInfo info) `seq`
197 seqDemand (demandInfo info) `seq`
198 seqRules (specInfo info) `seq`
199 seqTyGenInfo (tyGenInfo info) `seq`
200 seqStrictnessInfo (strictnessInfo info) `seq`
201 seqWorker (workerInfo info) `seq`
203 -- seqUnfolding (unfoldingInfo info) `seq`
204 -- Omitting this improves runtimes a little, presumably because
205 -- some unfoldings are not calculated at all
207 -- CgInfo is involved in a loop, so we have to be careful not to seq it
209 -- seqCg (cgInfo info) `seq`
210 seqCpr (cprInfo info) `seq`
211 seqLBVar (lbvarInfo info) `seq`
212 seqOccInfo (occInfo info)
218 setWorkerInfo info wk = wk `seq` info { workerInfo = wk }
219 setSpecInfo info sp = PSEQ sp (info { specInfo = sp })
220 setTyGenInfo info tg = tg `seq` info { tyGenInfo = tg }
221 setInlinePragInfo info pr = pr `seq` info { inlinePragInfo = pr }
222 setOccInfo info oc = oc `seq` info { occInfo = oc }
223 setStrictnessInfo info st = st `seq` info { strictnessInfo = st }
224 -- Try to avoid spack leaks by seq'ing
226 setUnfoldingInfo info uf
227 | isEvaldUnfolding uf && isStrict (demandInfo info)
228 -- If the unfolding is a value, the demand info may
229 -- go pear-shaped, so we nuke it. Example:
231 -- case x of (p,q) -> h p q x
232 -- Here x is certainly demanded. But after we've nuked
233 -- the case, we'll get just
234 -- let x = (a,b) in h a b x
235 -- and now x is not demanded (I'm assuming h is lazy)
236 -- This really happens. The solution here is a bit ad hoc...
237 = info { unfoldingInfo = uf, demandInfo = wwLazy }
240 -- We do *not* seq on the unfolding info, For some reason, doing so
241 -- actually increases residency significantly.
242 = info { unfoldingInfo = uf }
244 setDemandInfo info dd = info { demandInfo = dd }
245 setArityInfo info ar = info { arityInfo = ar }
246 setCgInfo info cg = info { cgInfo = cg }
247 setCprInfo info cp = info { cprInfo = cp }
248 setLBVarInfo info lb = info { lbvarInfo = lb }
253 vanillaIdInfo :: IdInfo
257 arityInfo = UnknownArity,
259 specInfo = emptyCoreRules,
260 tyGenInfo = noTyGenInfo,
261 workerInfo = NoWorker,
262 strictnessInfo = NoStrictnessInfo,
263 unfoldingInfo = noUnfolding,
265 lbvarInfo = NoLBVarInfo,
266 inlinePragInfo = NoInlinePragInfo,
270 noCafNoTyGenIdInfo = vanillaIdInfo `setTyGenInfo` TyGenNever
271 `setCgInfo` (CgInfo 0 NoCafRefs)
272 -- Used for built-in type Ids in MkId.
273 -- Many built-in things have fixed types, so we shouldn't
274 -- run around generalising them
278 %************************************************************************
280 \subsection[arity-IdInfo]{Arity info about an @Id@}
282 %************************************************************************
284 For locally-defined Ids, the code generator maintains its own notion
285 of their arities; so it should not be asking... (but other things
286 besides the code-generator need arity info!)
290 = UnknownArity -- No idea
292 | ArityExactly Arity -- Arity is exactly this. We use this when importing a
293 -- function; it's already been compiled and we know its
296 | ArityAtLeast Arity -- A partial application of this Id to up to n-1 value arguments
297 -- does essentially no work. That is not necessarily the
298 -- same as saying that it has n leading lambdas, because coerces
299 -- may get in the way.
301 -- functions in the module being compiled. Their arity
302 -- might increase later in the compilation process, if
303 -- an extra lambda floats up to the binding site.
306 seqArity :: ArityInfo -> ()
307 seqArity a = arityLowerBound a `seq` ()
309 exactArity = ArityExactly
310 atLeastArity = ArityAtLeast
311 unknownArity = UnknownArity
313 arityLowerBound :: ArityInfo -> Arity
314 arityLowerBound UnknownArity = 0
315 arityLowerBound (ArityAtLeast n) = n
316 arityLowerBound (ArityExactly n) = n
318 hasArity :: ArityInfo -> Bool
319 hasArity UnknownArity = False
320 hasArity other = True
322 ppArityInfo UnknownArity = empty
323 ppArityInfo (ArityExactly arity) = hsep [ptext SLIT("ArityExactly"), int arity]
324 ppArityInfo (ArityAtLeast arity) = hsep [ptext SLIT("ArityAtLeast"), int arity]
327 %************************************************************************
329 \subsection{Inline-pragma information}
331 %************************************************************************
336 | IMustNotBeINLINEd Bool -- True <=> came from an INLINE prag, False <=> came from a NOINLINE prag
337 (Maybe Int) -- Phase number from pragma, if any
339 -- The True, Nothing case doesn't need to be recorded
341 -- SEE COMMENTS WITH CoreUnfold.blackListed on the
342 -- exact significance of the IMustNotBeINLINEd pragma
344 isNeverInlinePrag :: InlinePragInfo -> Bool
345 isNeverInlinePrag (IMustNotBeINLINEd _ Nothing) = True
346 isNeverInlinePrag other = False
348 neverInlinePrag :: InlinePragInfo
349 neverInlinePrag = IMustNotBeINLINEd True{-should be False? --SDM -} Nothing
351 instance Outputable InlinePragInfo where
352 -- This is now parsed in interface files
353 ppr NoInlinePragInfo = empty
354 ppr other_prag = ptext SLIT("__U") <> pprInlinePragInfo other_prag
356 pprInlinePragInfo NoInlinePragInfo = empty
357 pprInlinePragInfo (IMustNotBeINLINEd True Nothing) = empty
358 pprInlinePragInfo (IMustNotBeINLINEd True (Just n)) = brackets (int n)
359 pprInlinePragInfo (IMustNotBeINLINEd False Nothing) = brackets (char '!')
360 pprInlinePragInfo (IMustNotBeINLINEd False (Just n)) = brackets (char '!' <> int n)
362 instance Show InlinePragInfo where
363 showsPrec p prag = showsPrecSDoc p (ppr prag)
367 %************************************************************************
369 \subsection[TyGen-IdInfo]{Type generalisation info about an @Id@}
371 %************************************************************************
373 Certain passes (notably usage inference) may change the type of an
374 identifier, modifying all in-scope uses of that identifier
375 appropriately to maintain type safety.
377 However, some identifiers must not have their types changed in this
378 way, because their types are conjured up in the front end of the
379 compiler rather than being read from the interface file. Default
380 methods, dictionary functions, record selectors, and others are in
381 this category. (see comment at TcClassDcl.tcClassSig).
383 To indicate this property, such identifiers are marked TyGenNever.
385 Furthermore, if the usage inference generates a usage-specialised
386 variant of a function, we must NOT re-infer a fully-generalised type
387 at the next inference. This finer property is indicated by a
388 TyGenUInfo on the identifier.
392 = NoTyGenInfo -- no restriction on type generalisation
394 | TyGenUInfo [Maybe Type] -- restrict generalisation of this Id to
395 -- preserve specified usage annotations
397 | TyGenNever -- never generalise the type of this Id
400 For TyGenUInfo, the list has one entry for each usage annotation on
401 the type of the Id, in left-to-right pre-order (annotations come
402 before the type they annotate). Nothing means no restriction; Just
403 usOnce or Just usMany forces that annotation to that value. Other
404 usage annotations are illegal.
407 seqTyGenInfo :: TyGenInfo -> ()
408 seqTyGenInfo NoTyGenInfo = ()
409 seqTyGenInfo (TyGenUInfo us) = seqList us ()
410 seqTyGenInfo TyGenNever = ()
412 noTyGenInfo :: TyGenInfo
413 noTyGenInfo = NoTyGenInfo
415 isNoTyGenInfo :: TyGenInfo -> Bool
416 isNoTyGenInfo NoTyGenInfo = True
417 isNoTyGenInfo _ = False
419 -- NB: There's probably no need to write this information out to the interface file.
420 -- Why? Simply because imported identifiers never get their types re-inferred.
421 -- But it's definitely nice to see in dumps, it for debugging purposes.
423 ppTyGenInfo :: TyGenInfo -> SDoc
424 ppTyGenInfo NoTyGenInfo = empty
425 ppTyGenInfo (TyGenUInfo us) = ptext SLIT("__G") <+> text (tyGenInfoString us)
426 ppTyGenInfo TyGenNever = ptext SLIT("__G N")
428 tyGenInfoString us = map go us
429 where go Nothing = 'x' -- for legibility, choose
430 go (Just u) | u `eqUsage` usOnce = '1' -- chars with identity
431 | u `eqUsage` usMany = 'M' -- Z-encoding.
432 go other = pprPanic "IdInfo.tyGenInfoString: unexpected annotation" (ppr other)
434 instance Outputable TyGenInfo where
437 instance Show TyGenInfo where
438 showsPrec p c = showsPrecSDoc p (ppr c)
442 %************************************************************************
444 \subsection[worker-IdInfo]{Worker info about an @Id@}
446 %************************************************************************
448 If this Id has a worker then we store a reference to it. Worker
449 functions are generated by the worker/wrapper pass. This uses
450 information from the strictness and CPR analyses.
452 There might not be a worker, even for a strict function, because:
453 (a) the function might be small enough to inline, so no need
455 (b) the strictness info might be "SSS" or something, so no w/w split.
457 Sometimes the arity of a wrapper changes from the original arity from
458 which it was generated, so we always emit the "original" arity into
459 the interface file, as part of the worker info.
461 How can this happen? Sometimes we get
462 f = coerce t (\x y -> $wf x y)
463 at the moment of w/w split; but the eta reducer turns it into
465 which is perfectly fine except that the exposed arity so far as
466 the code generator is concerned (zero) differs from the arity
467 when we did the split (2).
469 All this arises because we use 'arity' to mean "exactly how many
470 top level lambdas are there" in interface files; but during the
471 compilation of this module it means "how many things can I apply
476 data WorkerInfo = NoWorker
478 -- The Arity is the arity of the *wrapper* at the moment of the
479 -- w/w split. See comments in MkIface.ifaceId, with the 'Worker' code.
481 seqWorker :: WorkerInfo -> ()
482 seqWorker (HasWorker id _) = id `seq` ()
483 seqWorker NoWorker = ()
485 ppWorkerInfo NoWorker = empty
486 ppWorkerInfo (HasWorker wk_id _) = ptext SLIT("__P") <+> ppr wk_id
488 workerExists :: WorkerInfo -> Bool
489 workerExists NoWorker = False
490 workerExists (HasWorker _ _) = True
492 workerId :: WorkerInfo -> Id
493 workerId (HasWorker id _) = id
495 wrapperArity :: WorkerInfo -> Arity
496 wrapperArity (HasWorker _ a) = a
500 %************************************************************************
502 \subsection[CG-IdInfo]{Code generator-related information}
504 %************************************************************************
506 CgInfo encapsulates calling-convention information produced by the code
507 generator. It is pasted into the IdInfo of each emitted Id by CoreTidy,
508 but only as a thunk --- the information is only actually produced further
509 downstream, by the code generator.
513 !Arity -- Exact arity for calling purposes
516 | NoCgInfo -- In debug mode we don't want a black hole here
519 -- noCgInfo is used for local Ids, which shouldn't need any CgInfo
522 noCgInfo = panic "NoCgInfo!"
525 cgArity (CgInfo arity _) = arity
526 cgCafInfo (CgInfo _ caf_info) = caf_info
528 setCafInfo info caf_info =
529 case cgInfo info of { CgInfo arity _ ->
530 info `setCgInfo` CgInfo arity caf_info }
532 setCgArity info arity =
533 case cgInfo info of { CgInfo _ caf_info ->
534 info `setCgInfo` CgInfo arity caf_info }
536 cgMayHaveCafRefs (CgInfo _ caf_info) = mayHaveCafRefs caf_info
538 seqCg c = c `seq` () -- fields are strict anyhow
540 vanillaCgInfo = CgInfo 0 MayHaveCafRefs -- Definitely safe
542 -- CafInfo is used to build Static Reference Tables (see simplStg/SRT.lhs).
545 = MayHaveCafRefs -- either:
546 -- (1) A function or static constructor
547 -- that refers to one or more CAFs,
548 -- (2) A real live CAF
550 | NoCafRefs -- A function or static constructor
551 -- that refers to no CAFs.
553 mayHaveCafRefs MayHaveCafRefs = True
554 mayHaveCafRefs _ = False
556 seqCaf c = c `seq` ()
558 pprCgInfo (CgInfo arity caf_info) = ppArity arity <+> ppCafInfo caf_info
561 ppArity n = hsep [ptext SLIT("__A"), int n]
563 ppCafInfo NoCafRefs = ptext SLIT("__C")
564 ppCafInfo MayHaveCafRefs = empty
568 type CgInfoEnv = NameEnv CgInfo
570 lookupCgInfo :: NameEnv CgInfo -> Name -> CgInfo
571 lookupCgInfo env n = case lookupNameEnv env n of
573 Nothing -> pprTrace "Urk! Not in CgInfo env" (ppr n) vanillaCgInfo
577 %************************************************************************
579 \subsection[cpr-IdInfo]{Constructed Product Result info about an @Id@}
581 %************************************************************************
583 If the @Id@ is a function then it may have CPR info. A CPR analysis
584 phase detects whether:
588 The function's return value has a product type, i.e. an algebraic type
589 with a single constructor. Examples of such types are tuples and boxed
592 The function always 'constructs' the value that it is returning. It
593 must do this on every path through, and it's OK if it calls another
594 function which constructs the result.
597 If this is the case then we store a template which tells us the
598 function has the CPR property and which components of the result are
604 | ReturnsCPR -- Yes, this function returns a constructed product
605 -- Implicitly, this means "after the function has been applied
606 -- to all its arguments", so the worker/wrapper builder in
607 -- WwLib.mkWWcpr checks that that it is indeed saturated before
608 -- making use of the CPR info
610 -- We used to keep nested info about sub-components, but
611 -- we never used it so I threw it away
615 seqCpr :: CprInfo -> ()
616 seqCpr ReturnsCPR = ()
617 seqCpr NoCPRInfo = ()
619 noCprInfo = NoCPRInfo
621 ppCprInfo NoCPRInfo = empty
622 ppCprInfo ReturnsCPR = ptext SLIT("__M")
624 instance Outputable CprInfo where
627 instance Show CprInfo where
628 showsPrec p c = showsPrecSDoc p (ppr c)
632 %************************************************************************
634 \subsection[lbvar-IdInfo]{Lambda-bound var info about an @Id@}
636 %************************************************************************
638 If the @Id@ is a lambda-bound variable then it may have lambda-bound
639 var info. The usage analysis (UsageSP) detects whether the lambda
640 binding this var is a ``one-shot'' lambda; that is, whether it is
641 applied at most once.
643 This information may be useful in optimisation, as computations may
644 safely be floated inside such a lambda without risk of duplicating
651 | LBVarInfo Type -- The lambda that binds this Id has this usage
652 -- annotation (i.e., if ==usOnce, then the
653 -- lambda is applied at most once).
654 -- The annotation's kind must be `$'
655 -- HACK ALERT! placing this info here is a short-term hack,
656 -- but it minimises changes to the rest of the compiler.
657 -- Hack agreed by SLPJ/KSW 1999-04.
659 seqLBVar l = l `seq` ()
663 hasNoLBVarInfo NoLBVarInfo = True
664 hasNoLBVarInfo other = False
666 noLBVarInfo = NoLBVarInfo
668 -- not safe to print or parse LBVarInfo because it is not really a
669 -- property of the definition, but a property of the context.
670 pprLBVarInfo NoLBVarInfo = empty
671 pprLBVarInfo (LBVarInfo u) | u `eqUsage` usOnce
672 = getPprStyle $ \ sty ->
675 else ptext SLIT("OneShot")
679 instance Outputable LBVarInfo where
682 instance Show LBVarInfo where
683 showsPrec p c = showsPrecSDoc p (ppr c)
687 %************************************************************************
689 \subsection{Bulk operations on IdInfo}
691 %************************************************************************
693 @zapLamInfo@ is used for lambda binders that turn out to to be
694 part of an unsaturated lambda
697 zapLamInfo :: IdInfo -> Maybe IdInfo
698 zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand})
699 | is_safe_occ && not (isStrict demand)
702 = Just (info {occInfo = safe_occ,
703 demandInfo = wwLazy})
705 -- The "unsafe" occ info is the ones that say I'm not in a lambda
706 -- because that might not be true for an unsaturated lambda
707 is_safe_occ = case occ of
708 OneOcc in_lam once -> in_lam
711 safe_occ = case occ of
712 OneOcc _ once -> OneOcc insideLam once
717 zapDemandInfo :: IdInfo -> Maybe IdInfo
718 zapDemandInfo info@(IdInfo {demandInfo = demand})
719 | not (isStrict demand) = Nothing
720 | otherwise = Just (info {demandInfo = wwLazy})
724 copyIdInfo is used when shorting out a top-level binding
727 where f is exported. We are going to swizzle it around to
731 BUT (a) we must be careful about messing up rules
732 (b) we must ensure f's IdInfo ends up right
734 (a) Messing up the rules
736 The example that went bad on me was this one:
738 iterate :: (a -> a) -> a -> [a]
739 iterate = iterateList
741 iterateFB c f x = x `c` iterateFB c f (f x)
742 iterateList f x = x : iterateList f (f x)
745 "iterate" forall f x. iterate f x = build (\c _n -> iterateFB c f x)
746 "iterateFB" iterateFB (:) = iterateList
749 This got shorted out to:
751 iterateList :: (a -> a) -> a -> [a]
752 iterateList = iterate
754 iterateFB c f x = x `c` iterateFB c f (f x)
755 iterate f x = x : iterate f (f x)
758 "iterate" forall f x. iterate f x = build (\c _n -> iterateFB c f x)
759 "iterateFB" iterateFB (:) = iterate
762 And now we get an infinite loop in the rule system
763 iterate f x -> build (\cn -> iterateFB c f x)
767 Tiresome solution: don't do shorting out if f has rewrite rules.
768 Hence shortableIdInfo.
770 (b) Keeping the IdInfo right
771 ~~~~~~~~~~~~~~~~~~~~~~~~
772 We want to move strictness/worker info from f_local to f, but keep the rest.
776 shortableIdInfo :: IdInfo -> Bool
777 shortableIdInfo info = isEmptyCoreRules (specInfo info)
779 copyIdInfo :: IdInfo -- f_local
780 -> IdInfo -- f (the exported one)
781 -> IdInfo -- New info for f
782 copyIdInfo f_local f = f { strictnessInfo = strictnessInfo f_local,
783 workerInfo = workerInfo f_local,
784 cprInfo = cprInfo f_local