Commit 2d8ca917 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Fix -ddump-stg flag

-ddump-stg was dumping the initial STG (just after Core-to-STG pass)
which was misleading because we want the final STG to know if a function
allocates or not. Now we have a new flag -ddump-stg-from-core for this and
-ddump-stg is deprecated.
parent 659eb31b
......@@ -68,9 +68,9 @@ data DumpFlag
| Opt_D_dump_simpl_iterations
| Opt_D_dump_spec
| Opt_D_dump_prep
| Opt_D_dump_stg -- CoreToStg output
| Opt_D_dump_stg_unarised -- STG after unarise
| Opt_D_dump_stg_final -- STG after stg2stg
| Opt_D_dump_stg_from_core -- ^ Initial STG (CoreToStg output)
| Opt_D_dump_stg_unarised -- ^ STG after unarise
| Opt_D_dump_stg_final -- ^ Final STG (after stg2stg)
| Opt_D_dump_call_arity
| Opt_D_dump_exitify
| Opt_D_dump_stranal
......
......@@ -2586,12 +2586,15 @@ dynamic_flags_deps = [
(setDumpFlag Opt_D_dump_spec)
, make_ord_flag defGhcFlag "ddump-prep"
(setDumpFlag Opt_D_dump_prep)
, make_ord_flag defGhcFlag "ddump-stg"
(setDumpFlag Opt_D_dump_stg)
, make_ord_flag defGhcFlag "ddump-stg-from-core"
(setDumpFlag Opt_D_dump_stg_from_core)
, make_ord_flag defGhcFlag "ddump-stg-unarised"
(setDumpFlag Opt_D_dump_stg_unarised)
, make_ord_flag defGhcFlag "ddump-stg-final"
(setDumpFlag Opt_D_dump_stg_final)
, make_dep_flag defGhcFlag "ddump-stg"
(setDumpFlag Opt_D_dump_stg_from_core)
"Use `-ddump-stg-from-core` or `-ddump-stg-final` instead"
, make_ord_flag defGhcFlag "ddump-call-arity"
(setDumpFlag Opt_D_dump_call_arity)
, make_ord_flag defGhcFlag "ddump-exitify"
......
......@@ -52,7 +52,7 @@ stg2stg :: DynFlags -- includes spec of what stg-to-stg passes
-> IO [StgTopBinding] -- output program
stg2stg dflags this_mod binds
= do { dump_when Opt_D_dump_stg "STG:" binds
= do { dump_when Opt_D_dump_stg_from_core "Initial STG:" binds
; showPass dflags "Stg2Stg"
-- Do the main business!
; binds' <- runStgM 'g' $
......
......@@ -387,7 +387,7 @@ STG representation
These flags dump various phases of GHC's STG pipeline.
.. ghc-flag:: -ddump-stg
.. ghc-flag:: -ddump-stg-from-core
:shortdesc: Show CoreToStg output
:type: dynamic
......@@ -411,6 +411,14 @@ These flags dump various phases of GHC's STG pipeline.
Show the output of the last STG pass before we generate Cmm.
.. ghc-flag:: -ddump-stg
:shortdesc: *(deprecated)* Alias for :ghc-flag:`-ddump-stg-from-core`
:type: dynamic
Alias for :ghc-flag:`-ddump-stg-from-core`. Deprecated in favor of more explicit
flags: :ghc-flag:`-ddump-stg-from-core`, :ghc-flag:`-ddump-stg-final`, etc.
C-\\- representation
~~~~~~~~~~~~~~~~~~~~
......
......@@ -210,7 +210,7 @@ test('T12076lit', normal, compile, ['-O'])
test('T12076sat', normal, compile, ['-O'])
test('T12212', normal, compile, ['-O'])
test('noinline01', only_ways(['optasm']), compile, ['-ddump-stg -dsuppress-uniques -dsuppress-ticks -O'])
test('noinline01', only_ways(['optasm']), compile, ['-ddump-stg-from-core -dsuppress-uniques -dsuppress-ticks -O'])
test('par01', only_ways(['optasm']), compile, ['-ddump-prep -dsuppress-uniques -dsuppress-ticks -O2'])
test('T12776', normal, compile, ['-O2'])
test('T9509',
......
==================== STG: ====================
==================== Initial STG: ====================
Noinline01.f [InlPrag=INLINE (sat-args=1)]
:: forall {p}. p -> GHC.Types.Bool
[GblId, Arity=1, Str=<L,A>, Unf=OtherCon []] =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment