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