[Git][ghc/ghc][master] Dump `SpecConstr` specialisations separately

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Jun 9 19:20:01 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
26013cdc by Alexander McKenna at 2023-06-09T15:19:41-04:00
Dump `SpecConstr` specialisations separately

Introduce a `-ddump-spec-constr` flag which debugs specialisations from
`SpecConstr`. These are no longer shown when you use `-ddump-spec`.

- - - - -


5 changed files:

- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- docs/users_guide/9.8.1-notes.rst
- docs/users_guide/debugging.rst


Changes:

=====================================
compiler/GHC/Driver/Config/Core/Lint.hs
=====================================
@@ -87,7 +87,7 @@ coreDumpFlag (CoreDoDemand {})        = Just Opt_D_dump_stranal
 coreDumpFlag CoreDoCpr                = Just Opt_D_dump_cpranal
 coreDumpFlag CoreDoWorkerWrapper      = Just Opt_D_dump_worker_wrapper
 coreDumpFlag CoreDoSpecialising       = Just Opt_D_dump_spec
-coreDumpFlag CoreDoSpecConstr         = Just Opt_D_dump_spec
+coreDumpFlag CoreDoSpecConstr         = Just Opt_D_dump_spec_constr
 coreDumpFlag CoreCSE                  = Just Opt_D_dump_cse
 coreDumpFlag CoreDesugar              = Just Opt_D_dump_ds_preopt
 coreDumpFlag CoreDesugarOpt           = Just Opt_D_dump_ds


=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -107,6 +107,7 @@ data DumpFlag
    | Opt_D_dump_simpl
    | Opt_D_dump_simpl_iterations
    | Opt_D_dump_spec
+   | Opt_D_dump_spec_constr
    | Opt_D_dump_prep
    | Opt_D_dump_late_cc
    | Opt_D_dump_stg_from_core -- ^ Initial STG (CoreToStg output)


=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -1425,6 +1425,8 @@ dynamic_flags_deps = [
       (setDumpFlag Opt_D_dump_simpl_iterations)
   , make_ord_flag defGhcFlag "ddump-spec"
         (setDumpFlag Opt_D_dump_spec)
+  , make_ord_flag defGhcFlag "ddump-spec-constr"
+        (setDumpFlag Opt_D_dump_spec_constr)
   , make_ord_flag defGhcFlag "ddump-prep"
         (setDumpFlag Opt_D_dump_prep)
   , make_ord_flag defGhcFlag "ddump-late-cc"


=====================================
docs/users_guide/9.8.1-notes.rst
=====================================
@@ -128,6 +128,10 @@ Compiler
 
   GHC used to accept the contradictory ``Int~Bool`` in the type signature, but reject the ``Int~Bool`` constraint that arises from typechecking the definition itself.  Now it accepts both.  More details in `GHC ticket #23413 <https://gitlab.haskell.org/ghc/ghc/-/issues/23413>`_, which gives examples of the previous inconsistency.  GHC now implements the "PermissivePlan" described in that ticket.
 
+- The `-ddump-spec` flag has been split into `-ddump-spec` and
+  `-ddump-spec-constr`, allowing only output from the typeclass specialiser or
+  `SpecConstr` to be seen if desired.
+
 GHCi
 ~~~~
 


=====================================
docs/users_guide/debugging.rst
=====================================
@@ -324,7 +324,15 @@ subexpression elimination pass.
     :shortdesc: Dump specialiser output
     :type: dynamic
 
-    Dump output of specialisation pass
+    Dump output of typeclass specialisation pass
+
+.. ghc-flag:: -ddump-spec-constr
+    :shortdesc: Dump specialiser output from SpecConstr
+    :type: dynamic
+
+    :since: 9.8.1
+
+    Dump output of the SpecConstr specialisation pass
 
 .. ghc-flag:: -ddump-rules
     :shortdesc: Dump rewrite rules



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/26013cdc40183c1b7ee4b5674750133d17f73a72
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/20230609/a915031f/attachment-0001.html>


More information about the ghc-commits mailing list