Note [Merging nested cases]

GHC/Core/Opt/Simplify/Utils.hs:2422 compiler

The basic case-merge stuff is described in Note [Merge Nested Cases] in GHC.Core.Utils

We do it here in `prepareAlts` (on InAlts) rather than after (on OutAlts) for two reasons:

* It "belongs" here with `filterAlts`, `refineDefaultAlt` and `combineIdenticalAlts`.

* In test perf/compiler/T22428 I found that I was getting extra Simplifer iterations:
    1. Create a join point
    2. That join point gets inlined at all call sites, so it is now dead.
    3. Case-merge happened, but left behind some trivial bindings (see `mergeCaseAlts`)
    4. Get rid of the trivial bindings
  The first two seem reasonable.  It's imaginable that we could do better on
  (3), by making case-merge join-point-aware, but it's not trivial.  But the
  fourth is just stupid.  Rather than always do an extra iteration, it's better
  to do the transformation on the input-end of teh Simplifier.

References 1

Referenced by 0

Nothing in the tree points here.