[Git][ghc/ghc][wip/par-simpl] 2 commits: comments

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Thu Nov 17 13:10:49 UTC 2022



Matthew Pickering pushed to branch wip/par-simpl at Glasgow Haskell Compiler / GHC


Commits:
2f0315e9 by Matthew Pickering at 2022-11-17T13:08:39+00:00
comments

- - - - -
4a9069be by Matthew Pickering at 2022-11-17T13:10:37+00:00
stub docs

- - - - -


2 changed files:

- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- docs/users_guide/using-optimisation.rst


Changes:

=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -268,7 +268,11 @@ simplScc (should_trace, env0, our_binders) deps b = {-# SCC simplScc #-} do
 
 
   -- Do something to rename local binders to avoid name clashes.
-  -- MP: I don't understand how this works, code was written by Doug
+  -- When we are simplifying we create the uniques for local bindings which are floated using
+  -- uniqAway. The values of these uniques is computed from the InScopeSet, in parralel the InScopeSet doesn't
+  -- contain all the top-level floated bindings so you can get name clashes.
+  -- Therefore a bit of hacky way to deal with this is to find all the local ids which have a unique from uniqAway and
+  -- replace them with a properly fresh unique from the unique supply. (Which is unique globally)
   (subst, !new_binds) <- getUniqueSupplyM <&> \us -> initUs_ us . mfix $ \ ~(subst_rec,_) -> let
       go_id :: Subst -> Id -> UniqSM (Subst, Id)
       go_id s i = do
@@ -356,6 +360,7 @@ simplTopBinds group_size env0 in_binds --(binds0, g)
             case te_simpl_threads (st_config te) of
               1 -> unSM (simpl_binds env1 (map snd (fst in_binds))) te sc
               _ -> do
+                -- Get from InScopeSet
                 let my_binds = mkUniqSet [lookupRecBndr env1 x | x <- bindersOfBinds (concatMap snd binds0)]
                 -- Create a result variable for each binding group
                 env_m_vars <- liftIO $ M.fromList <$> (sequence [(k,) <$> newEmptyMVar | (k,_) <- binds0])


=====================================
docs/users_guide/using-optimisation.rst
=====================================
@@ -945,19 +945,25 @@ by saying ``-fno-wombat``.
     more detailed list. Usually that identifies the loop quite
     accurately, because some numbers are very large.
 
-.. ghc-flag:: -fdmd-unbox-width=⟨n⟩
-    :shortdesc: *default: 3.* Boxity analysis pretends that returned records
-                              with this many fields can be unboxed.
+.. ghc-flag:: -fsimpl-threads=⟨n⟩
+    :shortdesc: *default: 1.* Use this many threads for parralel simplification
     :type: dynamic
     :category:
 
-    :default: 3
+    :default: 1
+
+    Par simpl
+
+
+.. ghc-flag:: -fsimpl-group-size=⟨n⟩
+    :shortdesc: *default: 10.* The number of bindings in each unit of work for paralell simplifier.
+    :type: dynamic
+    :category:
+
+    :default: 10
+
+    Group size
 
-    Boxity analysis optimistically pretends that a function returning a record
-    with at most ``-fdmd-unbox-width`` fields has only call sites that don't
-    need the box of the returned record. That may in turn allow more argument
-    unboxing to happen. Set to 0 to be completely conservative (which guarantees
-    that no reboxing will happen due to this mechanism).
 
 .. ghc-flag:: -fspec-constr
     :shortdesc: Turn on the SpecConstr transformation. Implied by :ghc-flag:`-O2`.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40984f3cbb8d9772c982ab8b6601ccc8a541323f...4a9069be5af7b11b7b058df93b889d92def24465

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40984f3cbb8d9772c982ab8b6601ccc8a541323f...4a9069be5af7b11b7b058df93b889d92def24465
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/20221117/c4b26c15/attachment-0001.html>


More information about the ghc-commits mailing list