[Git][ghc/ghc][wip/T22662] Wibble

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Fri Dec 23 16:54:46 UTC 2022



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


Commits:
ef5678be by Simon Peyton Jones at 2022-12-23T16:54:32+00:00
Wibble

- - - - -


1 changed file:

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


Changes:

=====================================
compiler/GHC/Core/Opt/FloatIn.hs
=====================================
@@ -37,6 +37,8 @@ import GHC.Types.Var.Set
 import GHC.Utils.Misc
 import GHC.Utils.Panic.Plain
 
+import GHC.Utils.Outputable
+
 {-
 Top-level interface function, @floatInwards at .  Note that we do not
 actually float any bindings downwards from the top-level.
@@ -136,6 +138,10 @@ type FloatInBinds    = [FloatInBind] -- In normal dependency order
 type RevFloatInBinds = [FloatInBind] -- In reverse dependency order
                                      --    (innermost binder first)
 
+instance Outputable FloatInBind where
+  ppr (FB bvs fvs _) = text "FB" <> braces (sep [ text "bndrs =" <+> ppr bvs
+                                                , text "fvs =" <+> ppr fvs ])
+
 fiExpr :: Platform
        -> RevFloatInBinds   -- Binds we're trying to drop
                             -- as far "inwards" as possible
@@ -763,8 +769,8 @@ sepBindsByDropPoint platform is_case floaters (here_fvs, fork_fvs)
           n_used_alts = count id used_in_flags -- returns number of Trues in list.
 
           cant_push
-            | is_case   = n_used_alts == n_alts   -- Used in all, don't push
-                                                  -- Remember n_alts > 1
+            | is_case   = (n_alts > 1 && n_used_alts == n_alts)
+                             -- Used in all, muliple branches, don't push
                           || (n_used_alts > 1 && not (floatIsDupable platform bind))
                              -- floatIsDupable: see Note [Duplicating floats]
 



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef5678bea88450ba9d8d4387379bbf0bf5f25326
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/20221223/558d4bc2/attachment-0001.html>


More information about the ghc-commits mailing list