3 * Allow {tv = TYPE ty) as a non-rec binding in Core
4 * Use this to make equality constraints more uniform
5 * Make DictBinds into Core
10 * A Given inst should be a CoVar, not a coercion
12 * finaliseEqInst should not need to call zonk
14 * Why do we need fromGivenEqDict? How could we construct
15 a Dict that had an EqPred?
16 newDictBndr should make an EqInst directly
18 * tc_co should be accessed only inside Inst
20 * Inst.mkImplicTy needs a commment about filtering out EqInsts
21 How *do* we deal with wanted equalities?
23 * Inst.instType behaves inconsistently for EqInsts: it should
24 return an EqPred, like the instType' hack in pprDictsTheta
26 Consequences: adjust the uses of instType in TcSimplify
28 * tcDeref* functions are unused, except in tcGenericNormalizeFamInst, when
29 we can equally well use TcMType.lookupTcTyVar
31 * Coercion.mkEqPredCoI looks very peculiar.
36 -------------------------
37 *** unexpected failure for jtod_circint(opt)
42 -----------------------------------------------------------------------------
45 * jumps to ImpossibleBranch should be removed.
48 - when updating a closure with an indirection to a function,
49 we should make a permanent indirection.
51 - check that we're bumping the scc count appropriately
53 * check perf & binary sizes against the HEAD
55 -----------------------------------------------------------------------------
58 * use STGCALL macros for foreign calls (doesn't look like volatile regs
59 are handled properly at the mo).
61 -----------------------------------------------------------------------------
66 * need to cater for unexported procedures/info tables?
68 * We should be able to get rid of entry labels, use info labels only.
69 - we need a %ENTRY_LBL(info_lbl) macro, so that instead of
70 JMP_(foo_entry) we can write jump %ENTRY_LBL(foo_info).
72 -----------------------------------------------------------------------------
74 * Move arg-descr from LFInfo to ClosureInfo?
75 But: only needed for functions
77 * Move all of CgClosure.link_caf into NewCaf, and newDynCaf
79 * If the case binder is dead, and the constr is nullary,
80 do we need to assign to Node?
83 -------------------------------
84 NB: all floats are let-binds, but some non-rec lets
85 may be unlifted (with RHS ok-for-speculation)
88 simplArg: [use strictness]
89 [used for non-top-lvl non-rec RHS or function arg]
90 if strict-type || demanded
93 simplExpr ---> (floats,expr)
94 float all the floats if exposes constr app, return expr
96 simpl (applied lambda) ==> simplNonRecBind
97 simpl (Let (NonRec ...) ..) ==> simplNonRecBind
99 simpl (Let (Rec ...) ..) ==> simplRecBind
102 simplify binders (but not its IdInfo)
103 simplify the pairs one at a time
106 simplNonRecBind: [was simplBeta]
107 [used for non-top-lvl non-rec bindings]
108 - check for PreInlineUnconditionally
109 - simplify binder, including its IdInfo
112 addCaseBind [which makes a let if ok-for-spec]
116 simplLazyBind: [binder already simplified, but not its IdInfo]
117 [used for both rec and top-lvl non-rec]
118 [must not be strict/unboxed; case not allowed]
119 - check for PreInlineUnconditionally
120 - substituteIdInfo and add result to in-scope
121 [so that rules are available in rec rhs]
122 - simplExpr --> (floats,expr)
123 - float: lifted floats only
124 if exposes constructor or pap (even if non-triv args)
129 completeLazyBind: [given a simplified RHS]
130 [used for both rec and non-rec bindings, top level and not]
131 - try discarding dead
132 - try PostInlineUnconditionally
133 - let-bind coerce arg and repeat
134 - try rhs tylam (float)
135 - try eta expand (float) [not if any float is unlifted && (non-spec || top_lvl || rec)]
136 - let-bind constructor args [not if any float is ..as above..]
138 - add unfolding [this is the only place we add an unfolding]
146 For eta expansion, we want to catch things like
148 case e of (a,b) -> \x -> case a of (p,q) -> \y -> r
150 If the \x was on the RHS of a let, we'd eta expand to bring the two
151 lambdas together. And in general that's a good thing to do. Perhaps
152 we should eta expand wherever we find a (value) lambda? Then the eta
153 expansion at a let RHS can concentrate solely on the PAP case.