1 NB: all floats are let-binds, but some non-rec lets
2 may be unlifted (with RHS ok-for-speculation)
5 simplArg: [use strictness]
6 [used for non-top-lvl non-rec RHS or function arg]
7 if strict-type || demanded
10 simplExpr ---> (floats,expr)
11 float all the floats if exposes constr app, return expr
13 simpl (applied lambda) ==> simplNonRecBind
14 simpl (Let (NonRec ...) ..) ==> simplNonRecBind
16 simpl (Let (Rec ...) ..) ==> simplRecBind
19 simplify binders (but not its IdInfo)
20 simplify the pairs one at a time
23 simplNonRecBind: [was simplBeta]
24 [used for non-top-lvl non-rec bindings]
25 - check for PreInlineUnconditionally
26 - simplify binder, including its IdInfo
29 addCaseBind [which makes a let if ok-for-spec]
33 simplRecPair: [binder already simplified, but not its IdInfo]
34 [used for both rec and top-lvl non-rec]
35 [must not be strict/unboxed; case not allowed]
36 - check for PreInlineUnconditionally
37 - substituteIdInfo and add result to in-scope
38 [so that rules are available in rec rhs]
39 - simplExpr --> (floats,expr)
40 - float: lifted floats only
41 if exposes constructor or pap (even if non-triv args)
46 completeLazyBind: [given a simplified RHS]
47 [used for both rec and non-rec bindings, top level and not]
49 - try PostInlineUnconditionally
50 - let-bind coerce arg and repeat
51 - try rhs tylam (float)
52 - try eta expand (float) [not if any float is unlifted && (non-spec || top_lvl || rec)]
53 - let-bind constructor args [not if any float is ..as above..]
55 - add unfolding [this is the only place we add an unfolding]