[Git][ghc/ghc][wip/T17910] 2 commits: Float bottoming expressions too!

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu Aug 10 10:10:39 UTC 2023



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


Commits:
2fcac9df by Simon Peyton Jones at 2023-08-10T11:08:59+01:00
Float bottoming expressions too!

- - - - -
08151960 by Simon Peyton Jones at 2023-08-10T11:10:16+01:00
Remove debug trace

- - - - -


1 changed file:

- compiler/GHC/Core/Opt/SetLevels.hs


Changes:

=====================================
compiler/GHC/Core/Opt/SetLevels.hs
=====================================
@@ -738,8 +738,9 @@ lvlMFE env strict_ctxt ann_expr
 
     -- See Note [Floating to the top]
     saves_alloc =  isTopLvl dest_lvl
-                && (floatConsts env || is_function)   -- Always float constant lambdas
-                                                      -- T5237 is a good example
+                && (floatConsts env || is_function || is_bot_lam)
+                                  -- Always float constant lambdas
+                                  -- T5237 is a good example
                 && (   not strict_ctxt                     -- (a)
                     || exprIsHNF expr                      -- (b)
                     || (is_bot_lam && escapes_value_lam))  -- (c)
@@ -1175,8 +1176,7 @@ lvlBind env (AnnNonRec bndr rhs)
     is_join       = isJoinPoint mb_join_arity
 
 lvlBind env (AnnRec pairs)
-  |  pprTrace "lvlBind" (ppr (map fst pairs) $$ ppr dest_lvl $$ ppr (profitableFloat env dest_lvl)) $
-     floatTopLvlOnly env && not (isTopLvl dest_lvl)
+  |  floatTopLvlOnly env && not (isTopLvl dest_lvl)
          -- Only floating to the top level is allowed.
   || not (profitableFloat env dest_lvl)
   || (isTopLvl dest_lvl && any (mightBeUnliftedType . idType) bndrs)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d1717adc0c8d0d985b8d32431af554d8f63ee254...08151960d8206c8617e91e0fd417d26eee552bc6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d1717adc0c8d0d985b8d32431af554d8f63ee254...08151960d8206c8617e91e0fd417d26eee552bc6
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230810/ca509f7a/attachment-0001.html>


More information about the ghc-commits mailing list