[Git][ghc/ghc][wip/simplifier-tweaks] One more wibble

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



Simon Peyton Jones pushed to branch wip/simplifier-tweaks at Glasgow Haskell Compiler / GHC


Commits:
b8610501 by Simon Peyton Jones at 2023-08-03T23:39:37+01:00
One more wibble

Don't float an unlifted join point

- - - - -


1 changed file:

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


Changes:

=====================================
compiler/GHC/Core/Opt/SetLevels.hs
=====================================
@@ -1267,19 +1267,21 @@ dontFloatNonRec env dest_lvl is_bot bndr bndr_ty deann_rhs
   | not (profitableFloat env dest_lvl)
   = True
 
-  | JoinPoint join_arity <- idJoinPointHood bndr
-  , let (_, body) = collectNBinders join_arity deann_rhs
-  = not (isTopLvl dest_lvl) || (not is_bot && exprIsCheap body)
-
   | isTopLvl dest_lvl
   , not (exprIsTopLevelBindable deann_rhs bndr_ty)
   = True     -- We can't float an unlifted binding to top level (except
              -- literal strings), so we don't float it at all.  It's a
              -- bit brutal, but unlifted bindings aren't expensive either
 
+  | JoinPoint join_arity <- idJoinPointHood bndr
+  , let (_, body) = collectNBinders join_arity deann_rhs
+  =  not (isTopLvl dest_lvl)
+  || (not is_bot && exprIsCheap body)
+
   | otherwise
   = False
 
+
 profitableFloat :: LevelEnv -> Level -> Bool
 profitableFloat env dest_lvl
   =  (dest_lvl `ltMajLvl` le_ctxt_lvl env)  -- Escapes a value lambda



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b86105011f27bc5d86b25a8a37593d7acb6b6ce5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b86105011f27bc5d86b25a8a37593d7acb6b6ce5
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/20230803/4d2a8209/attachment-0001.html>


More information about the ghc-commits mailing list