Simon Peyton Jones pushed to branch wip/T23109a at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Core/Opt/SetLevels.hs
    ... ... @@ -708,9 +708,15 @@ lvlMFE env strict_ctxt ann_expr
    708 708
     
    
    709 709
         -- See Note [Floating to the top]
    
    710 710
         saves_alloc = isTopLvl dest_lvl
    
    711
    +               && (escapes_value_lam || floatConsts env)
    
    712
    +                  -- Always float allocation out of a value lambda
    
    713
    +                  --    if it gets to top level
    
    714
    +               && (not strict_ctxt || is_hnf || is_bot_lam)
    
    715
    +{-
    
    711 716
                    && (  (floatConsts env &&
    
    712 717
                            (not strict_ctxt || is_hnf))     -- (FT1) and (FT2)
    
    713 718
                       || (is_bot_lam && escapes_value_lam)) -- (FT3)
    
    719
    +-}
    
    714 720
     
    
    715 721
     hasFreeJoin :: LevelEnv -> DVarSet -> Bool
    
    716 722
     -- Has a free join point which is not being floated to top level.