3 * A Given inst should be a CoVar, not a coercion
5 * finaliseEqInst should not need to call zonk
7 * Why do we need fromGivenEqDict? How could we construct
8 a Dict that had an EqPred?
9 newDictBndr should make an EqInst directly
11 * tc_co should be accessed only inside Inst
13 * Inst.mkImplicTy needs a commment about filtering out EqInsts
14 How *do* we deal with wanted equalities?
16 * Inst.instType behaves inconsistently for EqInsts: it should
17 return an EqPred, like the instType' hack in pprDictsTheta
19 Consequences: adjust the uses of instType in TcSimplify
21 * tcDeref* functions are unused, except in tcGenericNormalizeFamInst, when
22 we can equally well use TcMType.lookupTcTyVar
24 * Coercion.mkEqPredCoI looks very peculiar.
29 -------------------------
30 *** unexpected failure for jtod_circint(opt)
35 -----------------------------------------------------------------------------
38 * jumps to ImpossibleBranch should be removed.
41 - when updating a closure with an indirection to a function,
42 we should make a permanent indirection.
44 - check that we're bumping the scc count appropriately
46 * check perf & binary sizes against the HEAD
48 -----------------------------------------------------------------------------
51 * use STGCALL macros for foreign calls (doesn't look like volatile regs
52 are handled properly at the mo).
54 -----------------------------------------------------------------------------
59 * need to cater for unexported procedures/info tables?
61 * We should be able to get rid of entry labels, use info labels only.
62 - we need a %ENTRY_LBL(info_lbl) macro, so that instead of
63 JMP_(foo_entry) we can write jump %ENTRY_LBL(foo_info).
65 -----------------------------------------------------------------------------
67 * Move arg-descr from LFInfo to ClosureInfo?
68 But: only needed for functions
70 * Move all of CgClosure.link_caf into NewCaf, and newDynCaf
72 * If the case binder is dead, and the constr is nullary,
73 do we need to assign to Node?
76 -------------------------------
77 NB: all floats are let-binds, but some non-rec lets
78 may be unlifted (with RHS ok-for-speculation)
81 simplArg: [use strictness]
82 [used for non-top-lvl non-rec RHS or function arg]
83 if strict-type || demanded
86 simplExpr ---> (floats,expr)
87 float all the floats if exposes constr app, return expr
89 simpl (applied lambda) ==> simplNonRecBind
90 simpl (Let (NonRec ...) ..) ==> simplNonRecBind
92 simpl (Let (Rec ...) ..) ==> simplRecBind
95 simplify binders (but not its IdInfo)
96 simplify the pairs one at a time
99 simplNonRecBind: [was simplBeta]
100 [used for non-top-lvl non-rec bindings]
101 - check for PreInlineUnconditionally
102 - simplify binder, including its IdInfo
105 addCaseBind [which makes a let if ok-for-spec]
109 simplLazyBind: [binder already simplified, but not its IdInfo]
110 [used for both rec and top-lvl non-rec]
111 [must not be strict/unboxed; case not allowed]
112 - check for PreInlineUnconditionally
113 - substituteIdInfo and add result to in-scope
114 [so that rules are available in rec rhs]
115 - simplExpr --> (floats,expr)
116 - float: lifted floats only
117 if exposes constructor or pap (even if non-triv args)
122 completeLazyBind: [given a simplified RHS]
123 [used for both rec and non-rec bindings, top level and not]
124 - try discarding dead
125 - try PostInlineUnconditionally
126 - let-bind coerce arg and repeat
127 - try rhs tylam (float)
128 - try eta expand (float) [not if any float is unlifted && (non-spec || top_lvl || rec)]
129 - let-bind constructor args [not if any float is ..as above..]
131 - add unfolding [this is the only place we add an unfolding]
139 For eta expansion, we want to catch things like
141 case e of (a,b) -> \x -> case a of (p,q) -> \y -> r
143 If the \x was on the RHS of a let, we'd eta expand to bring the two
144 lambdas together. And in general that's a good thing to do. Perhaps
145 we should eta expand wherever we find a (value) lambda? Then the eta
146 expansion at a let RHS can concentrate solely on the PAP case.