[Git][ghc/ghc][wip/simplifier-tweaks] Two more changes

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Jan 10 12:06:56 UTC 2024



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


Commits:
d65f14ac by Simon Peyton Jones at 2024-01-10T12:05:28+00:00
Two more changes

* Floating: float join point to top level if possible
* Inlining: treat jumps as free

- - - - -


2 changed files:

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


Changes:

=====================================
compiler/GHC/Core/Opt/SetLevels.hs
=====================================
@@ -1272,10 +1272,13 @@ dontFloatNonRec env dest_lvl is_bot bndr bndr_ty deann_rhs
              -- 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)
+
+--  | JoinPoint join_arity <- idJoinPointHood bndr
+--  , let (_, body) = collectNBinders join_arity deann_rhs
+--  =  not (isTopLvl dest_lvl)
+--   || (not is_bot && exprIsCheap body)
+  | isJoinId bndr  -- Join points either stay put, or float to top
+  = not (isTopLvl dest_lvl)
 
   | otherwise
   = False


=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -683,7 +683,7 @@ jumpSize
  :: Int  -- ^ number of value args
  -> Int  -- ^ number of value args that are void
  -> Int
-jumpSize n_val_args voids = 2 * (1 + n_val_args - voids)
+jumpSize _n_val_args _voids = 0 -- 2 * (1 + n_val_args - voids)
   -- A jump is 20% the size of a function call. Making jumps free reopens
   -- bug #6048, but making them any more expensive loses a 21% improvement in
   -- spectral/puzzle. TODO Perhaps adjusting the default threshold would be a



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d65f14ac65f733cd45f68e1780e1d507aaba4694
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/20240110/ddc12bb7/attachment-0001.html>


More information about the ghc-commits mailing list