[Git][ghc/ghc][wip/refactor-demand] Fix isWeakDmd, hopefully fixing an arduous performance regression in code generation

Sebastian Graf gitlab at gitlab.haskell.org
Tue Nov 3 12:06:14 UTC 2020



Sebastian Graf pushed to branch wip/refactor-demand at Glasgow Haskell Compiler / GHC


Commits:
901e38d7 by Sebastian Graf at 2020-11-03T13:06:08+01:00
Fix isWeakDmd, hopefully fixing an arduous performance regression in code generation

- - - - -


1 changed file:

- compiler/GHC/Types/Demand.hs


Changes:

=====================================
compiler/GHC/Types/Demand.hs
=====================================
@@ -712,7 +712,7 @@ isScaleInvariantCleanDmd (Call n _) = isScaleInvariantCard n -- See Note [Scalin
 -- was incomplete.
 -- See Note [Lazy and unleashable free variables] in "GHC.Core.Opt.DmdAnal".
 isWeakDmd :: Demand -> Bool
-isWeakDmd (n :* cd) = not (isStrict n) && isScaleInvariantCleanDmd cd
+isWeakDmd dmd@(n :* _) = not (isStrict n) && isScaleInvariantDmd dmd
 
 -- | @keepAliveDmdType dt vs@ makes sure that the Ids in @vs@ have
 -- /some/ usage in the returned demand types -- they are not Absent.
@@ -1201,9 +1201,6 @@ multDmdEnv n env
     -- match multDmd (see #13977).
   | n == C_11 = env
   | otherwise = mapVarEnv (multDmd n) env
-  -- For the Absent case just discard alC_ sage information
-  -- We only processed the thing at all to analyse the body
-  -- See Note [Always analyse in virgin pass]
 
 -- | See Note [Scaling demands]
 reuseEnv :: DmdEnv -> DmdEnv



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/901e38d7bf3bbe96dc252e05a2aa43a912f9f59c
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/20201103/1cdeebf0/attachment.html>


More information about the ghc-commits mailing list