[Git][ghc/ghc][master] 2 commits: Add more flags for dumping core passes (#23491)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Jun 14 21:18:12 UTC 2023



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


Commits:
078250ef by Jacco Krijnen at 2023-06-14T17:17:53-04:00
Add more flags for dumping core passes (#23491)

- - - - -
1b7604af by Jacco Krijnen at 2023-06-14T17:17:53-04:00
Add tests for dumping flags (#23491)

- - - - -


10 changed files:

- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- docs/users_guide/debugging.rst
- + testsuite/tests/simplCore/should_compile/T23491.hs
- + testsuite/tests/simplCore/should_compile/T23491a.stderr
- + testsuite/tests/simplCore/should_compile/T23491b.stderr
- + testsuite/tests/simplCore/should_compile/T23491c.stderr
- + testsuite/tests/simplCore/should_compile/T23491d.stderr
- testsuite/tests/simplCore/should_compile/all.T


Changes:

=====================================
compiler/GHC/Driver/Config/Core/Lint.hs
=====================================
@@ -77,10 +77,10 @@ initEndPassConfig dflags extra_vars name_ppr_ctx pass = EndPassConfig
 coreDumpFlag :: CoreToDo -> Maybe DumpFlag
 coreDumpFlag (CoreDoSimplify {})      = Just Opt_D_verbose_core2core
 coreDumpFlag (CoreDoPluginPass {})    = Just Opt_D_verbose_core2core
-coreDumpFlag CoreDoFloatInwards       = Just Opt_D_verbose_core2core
-coreDumpFlag (CoreDoFloatOutwards {}) = Just Opt_D_verbose_core2core
-coreDumpFlag CoreLiberateCase         = Just Opt_D_verbose_core2core
-coreDumpFlag CoreDoStaticArgs         = Just Opt_D_verbose_core2core
+coreDumpFlag CoreDoFloatInwards       = Just Opt_D_dump_float_in
+coreDumpFlag (CoreDoFloatOutwards {}) = Just Opt_D_dump_float_out
+coreDumpFlag CoreLiberateCase         = Just Opt_D_dump_liberate_case
+coreDumpFlag CoreDoStaticArgs         = Just Opt_D_dump_static_argument_transformation
 coreDumpFlag CoreDoCallArity          = Just Opt_D_dump_call_arity
 coreDumpFlag CoreDoExitify            = Just Opt_D_dump_exitify
 coreDumpFlag (CoreDoDemand {})        = Just Opt_D_dump_stranal


=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -127,6 +127,10 @@ data DumpFlag
    | Opt_D_dump_types
    | Opt_D_dump_rules
    | Opt_D_dump_cse
+   | Opt_D_dump_float_out
+   | Opt_D_dump_float_in
+   | Opt_D_dump_liberate_case
+   | Opt_D_dump_static_argument_transformation
    | Opt_D_dump_worker_wrapper
    | Opt_D_dump_rn_trace
    | Opt_D_dump_rn_stats


=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -1468,6 +1468,16 @@ dynamic_flags_deps = [
         (setDumpFlag Opt_D_dump_rules)
   , make_ord_flag defGhcFlag "ddump-cse"
         (setDumpFlag Opt_D_dump_cse)
+  , make_ord_flag defGhcFlag "ddump-float-out"
+        (setDumpFlag Opt_D_dump_float_out)
+  , make_ord_flag defGhcFlag "ddump-full-laziness"
+        (setDumpFlag Opt_D_dump_float_out)
+  , make_ord_flag defGhcFlag "ddump-float-in"
+        (setDumpFlag Opt_D_dump_float_in)
+  , make_ord_flag defGhcFlag "ddump-liberate-case"
+        (setDumpFlag Opt_D_dump_liberate_case)
+  , make_ord_flag defGhcFlag "ddump-static-argument-transformation"
+        (setDumpFlag Opt_D_dump_static_argument_transformation)
   , make_ord_flag defGhcFlag "ddump-worker-wrapper"
         (setDumpFlag Opt_D_dump_worker_wrapper)
   , make_ord_flag defGhcFlag "ddump-rn-trace"


=====================================
docs/users_guide/debugging.rst
=====================================
@@ -436,6 +436,31 @@ subexpression elimination pass.
 
     Dump common subexpression elimination (CSE) pass output
 
+.. ghc-flag:: -ddump-full-laziness
+              -ddump-float-out
+    :shortdesc: Dump full laziness pass output
+    :type: dynamic
+
+    Dump full laziness pass (also known as float-out) output (see :ghc-flag:`-ffull-laziness`)
+
+.. ghc-flag:: -ddump-float-in
+    :shortdesc: Dump float in output
+    :type: dynamic
+
+    Dump float-in pass output (see :ghc-flag:`-ffloat-in`)
+
+.. ghc-flag:: -ddump-liberate-case
+    :shortdesc: Dump liberate case output
+    :type: dynamic
+
+    Dump liberate case pass output (see :ghc-flag:`-fliberate-case`)
+
+.. ghc-flag:: -ddump-static-argument-transformation
+    :shortdesc: Dump static argument transformation output
+    :type: dynamic
+
+    Dump static argument transformation pass output (see :ghc-flag:`-fstatic-argument-transformation`)
+
 .. ghc-flag:: -ddump-worker-wrapper
     :shortdesc: Dump worker-wrapper output
     :type: dynamic


=====================================
testsuite/tests/simplCore/should_compile/T23491.hs
=====================================
@@ -0,0 +1 @@
+main = putStrLn "Hello world"


=====================================
testsuite/tests/simplCore/should_compile/T23491a.stderr
=====================================
@@ -0,0 +1,4 @@
+==================== Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = False}) ====================
+Result size of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = False})
+==================== Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True}) ====================
+Result size of Float out(FOS {Lam = Just 0, Consts = True, OverSatApps = True})


=====================================
testsuite/tests/simplCore/should_compile/T23491b.stderr
=====================================
@@ -0,0 +1,4 @@
+==================== Float inwards ====================
+Result size of Float inwards
+==================== Float inwards ====================
+Result size of Float inwards


=====================================
testsuite/tests/simplCore/should_compile/T23491c.stderr
=====================================
@@ -0,0 +1,2 @@
+==================== Liberate case ====================
+Result size of Liberate case


=====================================
testsuite/tests/simplCore/should_compile/T23491d.stderr
=====================================
@@ -0,0 +1,2 @@
+==================== Static argument ====================
+Result size of Static argument


=====================================
testsuite/tests/simplCore/should_compile/all.T
=====================================
@@ -484,3 +484,8 @@ test('T23307a', normal, compile, ['-O -ddump-simpl -dno-typeable-binds -dsuppres
 test('T23307b', normal, compile, ['-O'])
 test('T23307c', normal, compile, ['-O'])
 test('T23426', normal, compile, ['-O'])
+
+test('T23491a', [extra_files(['T23491.hs']), grep_errmsg(r'Float out')], multimod_compile, ['T23491', '-ffull-laziness -ddump-full-laziness'])
+test('T23491b', [extra_files(['T23491.hs']), grep_errmsg(r'Float inwards')], multimod_compile, ['T23491', '-ffloat-in -ddump-float-in'])
+test('T23491c', [extra_files(['T23491.hs']), grep_errmsg(r'Liberate case')], multimod_compile, ['T23491', '-fliberate-case -ddump-liberate-case'])
+test('T23491d', [extra_files(['T23491.hs']), grep_errmsg(r'Static argument')], multimod_compile, ['T23491', '-fstatic-argument-transformation -ddump-static-argument-transformation'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/100650e35d6d17965e293160785360933c9e0a25...1b7604af7dd8c787043ab46d4ad4f84bf131cd3c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/100650e35d6d17965e293160785360933c9e0a25...1b7604af7dd8c787043ab46d4ad4f84bf131cd3c
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/20230614/9c8653bb/attachment-0001.html>


More information about the ghc-commits mailing list