4 <:Useless:> is an optimization pass for the <:SSA:>
5 <:IntermediateLanguage:>, invoked from <:SSASimplify:>.
11 * removes components of tuples that are constants (use unification)
12 * removes function arguments that are constants
13 * builds some kind of dependence graph where
14 ** a value of ground type is useful if it is an arg to a primitive
15 ** a tuple is useful if it contains a useful component
16 ** a constructor is useful if it contains a useful component or is used in a `Case` transfer
18 If a useful tuple is coerced to another useful tuple, then all of
19 their components must agree (exactly). It is trivial to convert a
20 useful value to a useless one.
24 * <!ViewGitFile(mlton,master,mlton/ssa/useless.fun)>
26 == Details and Notes ==
28 It is also trivial to convert a useful tuple to one of its useful
29 components -- but this seems hard.
31 Suppose that you have a `ref`/`array`/`vector` that is useful, but the
32 components aren't -- then the components are converted to type `unit`,
33 and any primitive args must be as well.
35 Unify all handler arguments so that `raise`/`handle` has a consistent