From: Ben Lippmeier Date: Wed, 27 Apr 2011 06:40:48 +0000 (+1000) Subject: Merge branch 'master' of /Users/benl/devel/ghc/ghc-head X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=dc2575083cbc8680e15f4eee8956a9487fc56ddc;hp=7bb9684495e6724d6325719e76926cd35535f3af Merge branch 'master' of /Users/benl/devel/ghc/ghc-head --- diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs index eddc9ca..732224b 100644 --- a/compiler/main/StaticFlags.hs +++ b/compiler/main/StaticFlags.hs @@ -192,16 +192,12 @@ opt_IgnoreDotGhci = lookUp (fsLit "-ignore-dot-ghci") -- debugging options -- | Suppress all that is suppressable in core dumps. +-- Except for uniques, as some simplifier phases introduce new varibles that +-- have otherwise identical names. opt_SuppressAll :: Bool opt_SuppressAll = lookUp (fsLit "-dsuppress-all") --- | Suppress unique ids on variables. -opt_SuppressUniques :: Bool -opt_SuppressUniques - = lookUp (fsLit "-dsuppress-all") - || lookUp (fsLit "-dsuppress-uniques") - -- | Suppress all coercions, them replacing with '...' opt_SuppressCoercions :: Bool opt_SuppressCoercions @@ -232,10 +228,16 @@ opt_SuppressTypeSignatures = lookUp (fsLit "-dsuppress-all") || lookUp (fsLit "-dsuppress-type-signatures") +-- | Suppress unique ids on variables. +-- Except for uniques, as some simplifier phases introduce new variables that +-- have otherwise identical names. +opt_SuppressUniques :: Bool +opt_SuppressUniques + = lookUp (fsLit "-dsuppress-uniques") -- | Display case expressions with a single alternative as strict let bindings opt_PprCaseAsLet :: Bool -opt_PprCaseAsLet = lookUp (fsLit "-dppr-case-as-let") +opt_PprCaseAsLet = lookUp (fsLit "-dppr-case-as-let") -- | Set the maximum width of the dumps -- If GHC's command line options are bad then the options parser uses the diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs index c527d82..6ddcff2 100644 --- a/compiler/simplCore/CoreMonad.lhs +++ b/compiler/simplCore/CoreMonad.lhs @@ -370,13 +370,21 @@ getCoreToDo dflags simpl_phase phase names iter = CoreDoPasses - [ maybe_strictness_before phase + $ [ maybe_strictness_before phase , CoreDoSimplify iter (base_mode { sm_phase = Phase phase , sm_names = names }) - , maybe_rule_check (Phase phase) - ] + , maybe_rule_check (Phase phase) ] + + -- Vectorisation can introduce a fair few common sub expressions involving + -- DPH primitives. For example, see the Reverse test from dph-examples. + -- We need to eliminate these common sub expressions before their definitions + -- are inlined in phase 2. The CSE introduces lots of v1 = v2 bindings, + -- so we also run simpl_gently to inline them. + ++ (if dopt Opt_Vectorise dflags && phase == 3 + then [CoreCSE, simpl_gently] + else []) vectorisation = runWhen (dopt Opt_Vectorise dflags) $ diff --git a/docs/users_guide/debugging.xml b/docs/users_guide/debugging.xml index 6fc1413..b84134a 100644 --- a/docs/users_guide/debugging.xml +++ b/docs/users_guide/debugging.xml @@ -476,6 +476,88 @@ style. + + + + + Formatting dumps + + formatting dumps + + + + + + + + + In error messages, expressions are printed to a + certain “depth”, with subexpressions beyond the + depth replaced by ellipses. This flag sets the + depth. Its default value is 5. + + + + + + + + + + Set the width of debugging output. Use this if your code is wrapping too much. + For example: . + + + + + + + + + + Print single alternative case expressions as though they were strict + let expressions. This is helpful when your code does a lot of unboxing. + + + + + + + + + + Suppress any unsolicited debugging output. When GHC + has been built with the DEBUG option it + occasionally emits debug output of interest to developers. + The extra output can confuse the testing framework and + cause bogus test failures, so this flag is provided to + turn it off. + + + + + + + + Suppressing unwanted information + + suppression + + Core dumps contain a large amount of information. Depending on what you are doing, not all of it will be useful. + Use these flags to suppress the parts that you are not interested in. + + + + + + + + + Suppress everything that can be suppressed, except for unique ids as this often + makes the printout ambiguous. If you just want to see the overall structure of + the code, then start here. + + @@ -483,7 +565,7 @@ - Suppress the printing of uniques in debugging output. This may make + Suppress the printing of uniques. This may make the printout ambiguous (e.g. unclear where an occurrence of 'x' is bound), but it makes the output of two compiler runs have many fewer gratuitous differences, so you can realistically apply diff. Once diff @@ -493,12 +575,13 @@ - - + + - Suppress the printing of coercions in Core dumps to make them -shorter. + Suppress extended information about identifiers where they are bound. This includes + strictness information and inliner templates. Using this flag can cut the size + of the core dump in half, due to the lack of inliner templates @@ -508,36 +591,39 @@ shorter. - Suppress the printing of module qualification prefixes in Core dumps to make them easier to read. + Suppress the printing of module qualification prefixes. + This is the Data.List in Data.List.length. - - + + - In error messages, expressions are printed to a - certain “depth”, with subexpressions beyond the - depth replaced by ellipses. This flag sets the - depth. Its default value is 5. + Suppress the printing of type signatures. - - - + + + - - Suppress any unsolicited debugging output. When GHC - has been built with the DEBUG option it - occasionally emits debug output of interest to developers. - The extra output can confuse the testing framework and - cause bogus test failures, so this flag is provided to - turn it off. - + + Suppress the printing of type applications. + + + + + + + + + + Suppress the printing of type coercions. + diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 26ab9eb..73faae7 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -2468,32 +2468,68 @@ phase n - + + Don't output pragma info in dumps + static + - + + + + Set the depth for printing expressions in error msgs + static + - + + + + Set the width of debugging output. For example + static + - + + + + Print single alternative case expressions as strict lets. + static + - + + + + In core dumps, suppress everything that is suppressable. + static + - + + - Suppress the printing of uniques in debug output (easier to use diff. + Suppress the printing of uniques in debug output (easier to use diff) static - - - Suppress the printing of coercions in Core dumps to make them shorter. + + Suppress extended information about identifiers where they are bound static - - Suppress the printing of module qualification prefixes in Core dumps to make them easier to read. + Suppress the printing of module qualification prefixes static - - - Don't output pragma info in dumps + + Suppress type signatures static - - - Set the depth for printing expressions in error msgs + + Suppress type applications + static + - + + + + Suppress the printing of coercions in Core dumps to make them shorter static -