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
13 vanillaIdInfo, constantIdInfo, mkIdInfo, seqIdInfo, megaSeqIdInfo,
16 zapFragileInfo, zapLamInfo, zapSpecPragInfo, shortableIdInfo, copyIdInfo,
19 IdFlavour(..), flavourInfo,
20 setNoDiscardInfo, setFlavourInfo,
25 exactArity, atLeastArity, unknownArity, hasArity,
26 arityInfo, setArityInfo, ppArityInfo, arityLowerBound,
28 -- Strictness; imported from Demand
30 mkStrictnessInfo, noStrictnessInfo,
31 ppStrictnessInfo,isBottomingStrictness,
32 strictnessInfo, setStrictnessInfo,
34 -- Usage generalisation
36 tyGenInfo, setTyGenInfo,
37 noTyGenInfo, isNoTyGenInfo, ppTyGenInfo, tyGenInfoString,
40 WorkerInfo(..), workerExists, wrapperArity, workerId,
41 workerInfo, setWorkerInfo, ppWorkerInfo,
44 unfoldingInfo, setUnfoldingInfo,
47 demandInfo, setDemandInfo,
51 inlinePragInfo, setInlinePragInfo, pprInlinePragInfo,
52 isNeverInlinePrag, neverInlinePrag,
55 OccInfo(..), isFragileOcc, isDeadOcc, isLoopBreaker,
56 InsideLam, OneBranch, insideLam, notInsideLam, oneBranch, notOneBranch,
60 specInfo, setSpecInfo,
63 CafInfo(..), cafInfo, setCafInfo, ppCafInfo,
65 -- Constructed Product Result Info
66 CprInfo(..), cprInfo, setCprInfo, ppCprInfo, noCprInfo,
68 -- Lambda-bound variable info
69 LBVarInfo(..), lbvarInfo, setLBVarInfo, noLBVarInfo
72 #include "HsVersions.h"
76 import Type ( Type, usOnce )
77 import PrimOp ( PrimOp )
79 import BasicTypes ( OccInfo(..), isFragileOcc, isDeadOcc, seqOccInfo, isLoopBreaker,
80 InsideLam, insideLam, notInsideLam,
81 OneBranch, oneBranch, notOneBranch,
84 import DataCon ( DataCon )
85 import FieldLabel ( FieldLabel )
86 import Type ( usOnce, usMany )
87 import Demand -- Lots of stuff
89 import Util ( seqList )
91 infixl 1 `setDemandInfo`,
103 -- infixl so you can say (id `set` a `set` b)
106 An @IdInfo@ gives {\em optional} information about an @Id@. If
107 present it never lies, but it may not be present, in which case there
108 is always a conservative assumption which can be made.
110 There is one exception: the 'flavour' is *not* optional.
111 You must not discard it.
112 It used to be in Var.lhs, but that seems unclean.
114 Two @Id@s may have different info even though they have the same
115 @Unique@ (and are hence the same @Id@); for example, one might lack
116 the properties attached to the other.
118 The @IdInfo@ gives information about the value, or definition, of the
119 @Id@. It does {\em not} contain information about the @Id@'s usage
120 (except for @DemandInfo@? ToDo). (@lbvarInfo@ is also a marginal
126 flavourInfo :: IdFlavour, -- NOT OPTIONAL
127 arityInfo :: ArityInfo, -- Its arity
128 demandInfo :: Demand, -- Whether or not it is definitely demanded
129 specInfo :: CoreRules, -- Specialisations of this function which exist
130 tyGenInfo :: TyGenInfo, -- Restrictions on usage-generalisation of this Id
131 strictnessInfo :: StrictnessInfo, -- Strictness properties
132 workerInfo :: WorkerInfo, -- Pointer to Worker Function
133 unfoldingInfo :: Unfolding, -- Its unfolding
134 cafInfo :: CafInfo, -- whether it refers (indirectly) to any CAFs
135 cprInfo :: CprInfo, -- Function always constructs a product result
136 lbvarInfo :: LBVarInfo, -- Info about a lambda-bound variable
137 inlinePragInfo :: InlinePragInfo, -- Inline pragma
138 occInfo :: OccInfo -- How it occurs
141 seqIdInfo :: IdInfo -> ()
142 seqIdInfo (IdInfo {}) = ()
144 megaSeqIdInfo :: IdInfo -> ()
146 = seqFlavour (flavourInfo info) `seq`
147 seqArity (arityInfo info) `seq`
148 seqDemand (demandInfo info) `seq`
149 seqRules (specInfo info) `seq`
150 seqTyGenInfo (tyGenInfo info) `seq`
151 seqStrictnessInfo (strictnessInfo info) `seq`
152 seqWorker (workerInfo info) `seq`
154 -- seqUnfolding (unfoldingInfo info) `seq`
155 -- Omitting this improves runtimes a little, presumably because
156 -- some unfoldings are not calculated at all
158 seqCaf (cafInfo info) `seq`
159 seqCpr (cprInfo info) `seq`
160 seqLBVar (lbvarInfo info) `seq`
161 seqOccInfo (occInfo info)
167 setFlavourInfo info fl = fl `seq` info { flavourInfo = fl }
168 setWorkerInfo info wk = wk `seq` info { workerInfo = wk }
169 setSpecInfo info sp = PSEQ sp (info { specInfo = sp })
170 setTyGenInfo info tg = tg `seq` info { tyGenInfo = tg }
171 setInlinePragInfo info pr = pr `seq` info { inlinePragInfo = pr }
172 setOccInfo info oc = oc `seq` info { occInfo = oc }
173 setStrictnessInfo info st = st `seq` info { strictnessInfo = st }
174 -- Try to avoid spack leaks by seq'ing
176 setUnfoldingInfo info uf
177 | isEvaldUnfolding uf && isStrict (demandInfo info)
178 -- If the unfolding is a value, the demand info may
179 -- go pear-shaped, so we nuke it. Example:
181 -- case x of (p,q) -> h p q x
182 -- Here x is certainly demanded. But after we've nuked
183 -- the case, we'll get just
184 -- let x = (a,b) in h a b x
185 -- and now x is not demanded (I'm assuming h is lazy)
186 -- This really happens. The solution here is a bit ad hoc...
187 = info { unfoldingInfo = uf, demandInfo = wwLazy }
190 -- We do *not* seq on the unfolding info, For some reason, doing so
191 -- actually increases residency significantly.
192 = info { unfoldingInfo = uf }
194 setDemandInfo info dd = info { demandInfo = dd }
195 setArityInfo info ar = info { arityInfo = ar }
196 setCafInfo info cf = info { cafInfo = cf }
197 setCprInfo info cp = info { cprInfo = cp }
198 setLBVarInfo info lb = info { lbvarInfo = lb }
200 setNoDiscardInfo info = case flavourInfo info of
201 VanillaId -> info { flavourInfo = ExportedId }
203 zapSpecPragInfo info = case flavourInfo info of
204 SpecPragmaId -> info { flavourInfo = VanillaId }
210 vanillaIdInfo :: IdInfo
211 -- Used for locally-defined Ids
212 -- We are going to calculate correct CAF information at the end
213 vanillaIdInfo = mkIdInfo VanillaId NoCafRefs
215 constantIdInfo :: IdInfo
216 -- Used for imported Ids
217 -- The default is that they *do* have CAFs; an interface-file pragma
218 -- may say "oh no it doesn't", but in the absence of such a pragma
219 -- we'd better assume it does
220 constantIdInfo = mkIdInfo ConstantId MayHaveCafRefs
222 mkIdInfo :: IdFlavour -> IdInfo
226 arityInfo = UnknownArity,
228 specInfo = emptyCoreRules,
229 tyGenInfo = noTyGenInfo,
230 workerInfo = NoWorker,
231 strictnessInfo = NoStrictnessInfo,
232 unfoldingInfo = noUnfolding,
235 lbvarInfo = NoLBVarInfo,
236 inlinePragInfo = NoInlinePragInfo,
242 %************************************************************************
246 %************************************************************************
250 = VanillaId -- Locally defined, not exported
251 | ExportedId -- Locally defined, exported
252 | SpecPragmaId -- Locally defined, RHS holds specialised call
254 | ConstantId -- Imported from elsewhere, or a default method Id.
256 | DictFunId -- We flag dictionary functions so that we can
257 -- conveniently extract the DictFuns from a set of
258 -- bindings when building a module's interface
260 | DataConId DataCon -- The Id for a data constructor *worker*
261 | DataConWrapId DataCon -- The Id for a data constructor *wrapper*
262 -- [the only reasons we need to know is so that
263 -- a) we can suppress printing a definition in the interface file
264 -- b) when typechecking a pattern we can get from the
265 -- Id back to the data con]
266 | PrimOpId PrimOp -- The Id for a primitive operator
267 | RecordSelId FieldLabel -- The Id for a record selector
270 ppFlavourInfo :: IdFlavour -> SDoc
271 ppFlavourInfo VanillaId = empty
272 ppFlavourInfo ExportedId = ptext SLIT("[Exported]")
273 ppFlavourInfo SpecPragmaId = ptext SLIT("[SpecPrag]")
274 ppFlavourInfo ConstantId = ptext SLIT("[Constant]")
275 ppFlavourInfo DictFunId = ptext SLIT("[DictFun]")
276 ppFlavourInfo (DataConId _) = ptext SLIT("[DataCon]")
277 ppFlavourInfo (DataConWrapId _) = ptext SLIT("[DataConWrapper]")
278 ppFlavourInfo (PrimOpId _) = ptext SLIT("[PrimOp]")
279 ppFlavourInfo (RecordSelId _) = ptext SLIT("[RecSel]")
281 seqFlavour :: IdFlavour -> ()
282 seqFlavour f = f `seq` ()
285 The @SpecPragmaId@ exists only to make Ids that are
286 on the *LHS* of bindings created by SPECIALISE pragmas;
288 The SpecPragmaId is never itself mentioned; it
289 exists solely so that the specialiser will find
290 the call to f, and make specialised version of it.
291 The SpecPragmaId binding is discarded by the specialiser
292 when it gathers up overloaded calls.
293 Meanwhile, it is not discarded as dead code.
296 %************************************************************************
298 \subsection[arity-IdInfo]{Arity info about an @Id@}
300 %************************************************************************
302 For locally-defined Ids, the code generator maintains its own notion
303 of their arities; so it should not be asking... (but other things
304 besides the code-generator need arity info!)
308 = UnknownArity -- No idea
310 | ArityExactly Arity -- Arity is exactly this. We use this when importing a
311 -- function; it's already been compiled and we know its
314 | ArityAtLeast Arity -- A partial application of this Id to up to n-1 value arguments
315 -- does essentially no work. That is not necessarily the
316 -- same as saying that it has n leading lambdas, because coerces
317 -- may get in the way.
319 -- functions in the module being compiled. Their arity
320 -- might increase later in the compilation process, if
321 -- an extra lambda floats up to the binding site.
324 seqArity :: ArityInfo -> ()
325 seqArity a = arityLowerBound a `seq` ()
327 exactArity = ArityExactly
328 atLeastArity = ArityAtLeast
329 unknownArity = UnknownArity
331 arityLowerBound :: ArityInfo -> Arity
332 arityLowerBound UnknownArity = 0
333 arityLowerBound (ArityAtLeast n) = n
334 arityLowerBound (ArityExactly n) = n
336 hasArity :: ArityInfo -> Bool
337 hasArity UnknownArity = False
338 hasArity other = True
340 ppArityInfo UnknownArity = empty
341 ppArityInfo (ArityExactly arity) = hsep [ptext SLIT("__A"), int arity]
342 ppArityInfo (ArityAtLeast arity) = hsep [ptext SLIT("__AL"), int arity]
345 %************************************************************************
347 \subsection{Inline-pragma information}
349 %************************************************************************
354 | IMustNotBeINLINEd Bool -- True <=> came from an INLINE prag, False <=> came from a NOINLINE prag
355 (Maybe Int) -- Phase number from pragma, if any
357 -- The True, Nothing case doesn't need to be recorded
359 -- SEE COMMENTS WITH CoreUnfold.blackListed on the
360 -- exact significance of the IMustNotBeINLINEd pragma
362 isNeverInlinePrag :: InlinePragInfo -> Bool
363 isNeverInlinePrag (IMustNotBeINLINEd _ Nothing) = True
364 isNeverInlinePrag other = False
366 neverInlinePrag :: InlinePragInfo
367 neverInlinePrag = IMustNotBeINLINEd True{-should be False? --SDM -} Nothing
369 instance Outputable InlinePragInfo where
370 -- This is now parsed in interface files
371 ppr NoInlinePragInfo = empty
372 ppr other_prag = ptext SLIT("__U") <> pprInlinePragInfo other_prag
374 pprInlinePragInfo NoInlinePragInfo = empty
375 pprInlinePragInfo (IMustNotBeINLINEd True Nothing) = empty
376 pprInlinePragInfo (IMustNotBeINLINEd True (Just n)) = brackets (int n)
377 pprInlinePragInfo (IMustNotBeINLINEd False Nothing) = brackets (char '!')
378 pprInlinePragInfo (IMustNotBeINLINEd False (Just n)) = brackets (char '!' <> int n)
380 instance Show InlinePragInfo where
381 showsPrec p prag = showsPrecSDoc p (ppr prag)
385 %************************************************************************
387 \subsection[TyGen-IdInfo]{Type generalisation info about an @Id@}
389 %************************************************************************
391 Certain passes (notably usage inference) may change the type of an
392 identifier, modifying all in-scope uses of that identifier
393 appropriately to maintain type safety.
395 However, some identifiers must not have their types changed in this
396 way, because their types are conjured up in the front end of the
397 compiler rather than being read from the interface file. Default
398 methods, dictionary functions, record selectors, and others are in
399 this category. (see comment at TcClassDcl.tcClassSig).
401 To indicate this property, such identifiers are marked TyGenNever.
403 Furthermore, if the usage inference generates a usage-specialised
404 variant of a function, we must NOT re-infer a fully-generalised type
405 at the next inference. This finer property is indicated by a
406 TyGenUInfo on the identifier.
410 = NoTyGenInfo -- no restriction on type generalisation
412 | TyGenUInfo [Maybe Type] -- restrict generalisation of this Id to
413 -- preserve specified usage annotations
415 | TyGenNever -- never generalise the type of this Id
420 For TyGenUInfo, the list has one entry for each usage annotation on
421 the type of the Id, in left-to-right pre-order (annotations come
422 before the type they annotate). Nothing means no restriction; Just
423 usOnce or Just usMany forces that annotation to that value. Other
424 usage annotations are illegal.
427 seqTyGenInfo :: TyGenInfo -> ()
428 seqTyGenInfo NoTyGenInfo = ()
429 seqTyGenInfo (TyGenUInfo us) = seqList us ()
430 seqTyGenInfo TyGenNever = ()
432 noTyGenInfo :: TyGenInfo
433 noTyGenInfo = NoTyGenInfo
435 isNoTyGenInfo :: TyGenInfo -> Bool
436 isNoTyGenInfo NoTyGenInfo = True
437 isNoTyGenInfo _ = False
439 -- NB: There's probably no need to write this information out to the interface file.
440 -- Why? Simply because imported identifiers never get their types re-inferred.
441 -- But it's definitely nice to see in dumps, it for debugging purposes.
443 ppTyGenInfo :: TyGenInfo -> SDoc
444 ppTyGenInfo NoTyGenInfo = empty
445 ppTyGenInfo (TyGenUInfo us) = ptext SLIT("__G") <+> text (tyGenInfoString us)
446 ppTyGenInfo TyGenNever = ptext SLIT("__G N")
448 tyGenInfoString us = map go us
449 where go Nothing = 'x' -- for legibility, choose
450 go (Just u) | u == usOnce = '1' -- chars with identity
451 | u == usMany = 'M' -- Z-encoding.
452 go other = pprPanic "IdInfo.tyGenInfoString: unexpected annotation" (ppr other)
454 instance Outputable TyGenInfo where
457 instance Show TyGenInfo where
458 showsPrec p c = showsPrecSDoc p (ppr c)
462 %************************************************************************
464 \subsection[worker-IdInfo]{Worker info about an @Id@}
466 %************************************************************************
468 If this Id has a worker then we store a reference to it. Worker
469 functions are generated by the worker/wrapper pass. This uses
470 information from the strictness and CPR analyses.
472 There might not be a worker, even for a strict function, because:
473 (a) the function might be small enough to inline, so no need
475 (b) the strictness info might be "SSS" or something, so no w/w split.
479 data WorkerInfo = NoWorker
481 -- The Arity is the arity of the *wrapper* at the moment of the
482 -- w/w split. See comments in MkIface.ifaceId, with the 'Worker' code.
484 seqWorker :: WorkerInfo -> ()
485 seqWorker (HasWorker id _) = id `seq` ()
486 seqWorker NoWorker = ()
488 ppWorkerInfo NoWorker = empty
489 ppWorkerInfo (HasWorker wk_id _) = ptext SLIT("__P") <+> ppr wk_id
491 noWorkerInfo = NoWorker
493 workerExists :: WorkerInfo -> Bool
494 workerExists NoWorker = False
495 workerExists (HasWorker _ _) = True
497 workerId :: WorkerInfo -> Id
498 workerId (HasWorker id _) = id
500 wrapperArity :: WorkerInfo -> Arity
501 wrapperArity (HasWorker _ a) = a
505 %************************************************************************
507 \subsection[CAF-IdInfo]{CAF-related information}
509 %************************************************************************
511 This information is used to build Static Reference Tables (see
512 simplStg/ComputeSRT.lhs).
516 = MayHaveCafRefs -- either:
517 -- (1) A function or static constructor
518 -- that refers to one or more CAFs,
519 -- (2) A real live CAF
521 | NoCafRefs -- A function or static constructor
522 -- that refers to no CAFs.
524 -- LATER: not sure how easy this is...
528 seqCaf c = c `seq` ()
530 ppCafInfo NoCafRefs = ptext SLIT("__C")
531 ppCafInfo MayHaveCafRefs = empty
535 %************************************************************************
537 \subsection[cpr-IdInfo]{Constructed Product Result info about an @Id@}
539 %************************************************************************
541 If the @Id@ is a function then it may have CPR info. A CPR analysis
542 phase detects whether:
546 The function's return value has a product type, i.e. an algebraic type
547 with a single constructor. Examples of such types are tuples and boxed
550 The function always 'constructs' the value that it is returning. It
551 must do this on every path through, and it's OK if it calls another
552 function which constructs the result.
555 If this is the case then we store a template which tells us the
556 function has the CPR property and which components of the result are
562 | ReturnsCPR -- Yes, this function returns a constructed product
563 -- Implicitly, this means "after the function has been applied
564 -- to all its arguments", so the worker/wrapper builder in
565 -- WwLib.mkWWcpr checks that that it is indeed saturated before
566 -- making use of the CPR info
568 -- We used to keep nested info about sub-components, but
569 -- we never used it so I threw it away
573 seqCpr :: CprInfo -> ()
574 seqCpr ReturnsCPR = ()
575 seqCpr NoCPRInfo = ()
577 noCprInfo = NoCPRInfo
579 ppCprInfo NoCPRInfo = empty
580 ppCprInfo ReturnsCPR = ptext SLIT("__M")
582 instance Outputable CprInfo where
585 instance Show CprInfo where
586 showsPrec p c = showsPrecSDoc p (ppr c)
590 %************************************************************************
592 \subsection[lbvar-IdInfo]{Lambda-bound var info about an @Id@}
594 %************************************************************************
596 If the @Id@ is a lambda-bound variable then it may have lambda-bound
597 var info. The usage analysis (UsageSP) detects whether the lambda
598 binding this var is a ``one-shot'' lambda; that is, whether it is
599 applied at most once.
601 This information may be useful in optimisation, as computations may
602 safely be floated inside such a lambda without risk of duplicating
609 | LBVarInfo Type -- The lambda that binds this Id has this usage
610 -- annotation (i.e., if ==usOnce, then the
611 -- lambda is applied at most once).
612 -- The annotation's kind must be `$'
613 -- HACK ALERT! placing this info here is a short-term hack,
614 -- but it minimises changes to the rest of the compiler.
615 -- Hack agreed by SLPJ/KSW 1999-04.
617 seqLBVar l = l `seq` ()
621 noLBVarInfo = NoLBVarInfo
623 -- not safe to print or parse LBVarInfo because it is not really a
624 -- property of the definition, but a property of the context.
625 pprLBVarInfo NoLBVarInfo = empty
626 pprLBVarInfo (LBVarInfo u) | u == usOnce
627 = getPprStyle $ \ sty ->
630 else ptext SLIT("OneShot")
634 instance Outputable LBVarInfo where
637 instance Show LBVarInfo where
638 showsPrec p c = showsPrecSDoc p (ppr c)
642 %************************************************************************
644 \subsection{Bulk operations on IdInfo}
646 %************************************************************************
648 zapFragileInfo is used when cloning binders, mainly in the
649 simplifier. We must forget about used-once information because that
650 isn't necessarily correct in the transformed program.
651 Also forget specialisations and unfoldings because they would need
652 substitution to be correct. (They get pinned back on separately.)
655 zapFragileInfo :: IdInfo -> Maybe IdInfo
656 zapFragileInfo info@(IdInfo {occInfo = occ,
659 unfoldingInfo = unfolding})
660 | not (isFragileOcc occ)
661 -- We must forget about whether it was marked safe-to-inline,
662 -- because that isn't necessarily true in the simplified expression.
663 -- This is important because expressions may be re-simplified
664 -- We don't zap deadness or loop-breaker-ness.
665 -- The latter is important because it tells MkIface not to
666 -- spit out an inlining for the thing. The former doesn't
667 -- seem so important, but there's no harm.
669 && isEmptyCoreRules rules
670 -- Specialisations would need substituting. They get pinned
671 -- back on separately.
673 && not (workerExists wrkr)
675 && not (hasUnfolding unfolding)
676 -- This is very important; occasionally a let-bound binder is used
677 -- as a binder in some lambda, in which case its unfolding is utterly
678 -- bogus. Also the unfolding uses old binders so if we left it we'd
679 -- have to substitute it. Much better simply to give the Id a new
680 -- unfolding each time, which is what the simplifier does.
684 = Just (info {occInfo = robust_occ_info,
685 workerInfo = noWorkerInfo,
686 specInfo = emptyCoreRules,
687 unfoldingInfo = noUnfolding})
689 -- It's important to keep the loop-breaker info,
690 -- because the substitution doesn't remember it.
691 robust_occ_info = case occ of
692 OneOcc _ _ -> NoOccInfo
696 @zapLamInfo@ is used for lambda binders that turn out to to be
697 part of an unsaturated lambda
700 zapLamInfo :: IdInfo -> Maybe IdInfo
701 zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand})
702 | is_safe_occ && not (isStrict demand)
705 = Just (info {occInfo = safe_occ,
706 demandInfo = wwLazy})
708 -- The "unsafe" occ info is the ones that say I'm not in a lambda
709 -- because that might not be true for an unsaturated lambda
710 is_safe_occ = case occ of
711 OneOcc in_lam once -> in_lam
714 safe_occ = case occ of
715 OneOcc _ once -> OneOcc insideLam once
720 copyIdInfo is used when shorting out a top-level binding
723 where f is exported. We are going to swizzle it around to
727 BUT (a) we must be careful about messing up rules
728 (b) we must ensure f's IdInfo ends up right
730 (a) Messing up the rules
732 The example that went bad on me was this one:
734 iterate :: (a -> a) -> a -> [a]
735 iterate = iterateList
737 iterateFB c f x = x `c` iterateFB c f (f x)
738 iterateList f x = x : iterateList f (f x)
741 "iterate" forall f x. iterate f x = build (\c _n -> iterateFB c f x)
742 "iterateFB" iterateFB (:) = iterateList
745 This got shorted out to:
747 iterateList :: (a -> a) -> a -> [a]
748 iterateList = iterate
750 iterateFB c f x = x `c` iterateFB c f (f x)
751 iterate f x = x : iterate f (f x)
754 "iterate" forall f x. iterate f x = build (\c _n -> iterateFB c f x)
755 "iterateFB" iterateFB (:) = iterate
758 And now we get an infinite loop in the rule system
759 iterate f x -> build (\cn -> iterateFB c f x
763 Tiresome solution: don't do shorting out if f has rewrite rules.
764 Hence shortableIdInfo.
766 (b) Keeping the IdInfo right
767 ~~~~~~~~~~~~~~~~~~~~~~~~
768 We want to move strictness/worker info from f_local to f, but keep the rest.
772 shortableIdInfo :: IdInfo -> Bool
773 shortableIdInfo info = isEmptyCoreRules (specInfo info)
775 copyIdInfo :: IdInfo -- f_local
776 -> IdInfo -- f (the exported one)
777 -> IdInfo -- New info for f
778 copyIdInfo f_local f = f { strictnessInfo = strictnessInfo f_local,
779 workerInfo = workerInfo f_local,
780 cprInfo = cprInfo f_local