-{- OMITTED
- We don't want to be too keen about floating lets out of case alternatives
- because they may benefit from seeing the evaluation done by the case.
-
- The main reason for doing this is to allocate in fewer larger blocks
- but that's really an STG-level issue.
-
- case alts of
- -- Just one alternative, then dump only
- -- what *has* to be dumped
- AlgAlts [_] NoDefault -> partitionByLevel
- AlgAlts [] (BindDefault _ _) -> partitionByLevel
- PrimAlts [_] NoDefault -> partitionByLevel
- PrimAlts [] (BindDefault _ _) -> partitionByLevel
-
- -- If there's more than one alternative, then
- -- this is a dumping point
- other -> partitionByMajorLevel
--}
-
- float_alts (AlgAlts alts deflt)
- = case (float_deflt deflt) of { (fsd, fdd, deflt') ->
- case (unzip3 (map float_alg_alt alts)) of { (fsas, fdas, alts') ->
- (foldr add_stats fsd fsas,
- concat fdas ++ fdd,
- AlgAlts alts' deflt') }}
-
- float_alts (PrimAlts alts deflt)
- = case (float_deflt deflt) of { (fsd, fdd, deflt') ->
- case (unzip3 (map float_prim_alt alts)) of { (fsas, fdas, alts') ->
- (foldr add_stats fsd fsas,
- concat fdas ++ fdd,
- PrimAlts alts' deflt') }}
-
- -------------
- float_alg_alt (con, bs, rhs)