Merge branch 'master' of /Users/benl/devel/ghc/ghc-head
authorBen Lippmeier <benl@ouroborus.net>
Wed, 27 Apr 2011 06:40:48 +0000 (16:40 +1000)
committerBen Lippmeier <benl@ouroborus.net>
Wed, 27 Apr 2011 06:40:48 +0000 (16:40 +1000)
compiler/main/StaticFlags.hs
compiler/simplCore/CoreMonad.lhs
docs/users_guide/debugging.xml
docs/users_guide/flags.xml

index eddc9ca..732224b 100644 (file)
@@ -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
index c527d82..6ddcff2 100644 (file)
@@ -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) $
index 6fc1413..b84134a 100644 (file)
           style.</para>
        </listitem>
       </varlistentry>
+    </variablelist>
+  </sect2>
+
+  <sect2 id="formatting dumps">
+    <title>Formatting dumps</title>
+
+    <indexterm><primary>formatting dumps</primary></indexterm>
+
+     <variablelist>
+      <varlistentry>
+       <term>
+          <option>-dppr-user-length</option>
+          <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>In error messages, expressions are printed to a
+         certain &ldquo;depth&rdquo;, with subexpressions beyond the
+         depth replaced by ellipses.  This flag sets the
+         depth.  Its default value is 5.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dppr-colsNNN</option>
+          <indexterm><primary><option>-dppr-colsNNN</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Set the width of debugging output. Use this if your code is wrapping too much.
+               For example: <option>-dppr-cols200</option>.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dppr-case-as-let</option>
+          <indexterm><primary><option>-dppr-case-as-let</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Print single alternative case expressions as though they were strict 
+               let expressions. This is helpful when your code does a lot of unboxing.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>
+          <option>-dno-debug-output</option>
+          <indexterm><primary><option>-dno-debug-output</option></primary></indexterm>
+        </term>
+        <listitem>
+          <para>Suppress any unsolicited debugging output.  When GHC
+            has been built with the <literal>DEBUG</literal> 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.</para>
+        </listitem>
+      </varlistentry>
+     </variablelist>
+
+  </sect2>
+
+  <sect2 id="supression">
+    <title>Suppressing unwanted information</title>
+
+    <indexterm><primary>suppression</primary></indexterm>
+
+    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.
+
+    <variablelist>
+      <varlistentry>
+       <term>
+          <option>-dsuppress-all</option>
+          <indexterm><primary><option>-dsuppress-all</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>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.</para>
+       </listitem>
+      </varlistentry>
 
       <varlistentry>
        <term>
           <indexterm><primary><option>-dsuppress-uniques</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Suppress the printing of uniques in debugging output. This may make 
+         <para>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 <command>diff</command>.  Once <command>diff</command>
 
       <varlistentry>
        <term>
-          <option>-dsuppress-coercions</option>
-          <indexterm><primary><option>-dsuppress-coercions</option></primary></indexterm>
+          <option>-dsuppress-idinfo</option>
+          <indexterm><primary><option>-dsuppress-idinfo</option></primary></indexterm>
         </term>
        <listitem>
-          <para>Suppress the printing of coercions in Core dumps to make them
-shorter.</para>
+         <para>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</para>
        </listitem>
       </varlistentry>
 
@@ -508,36 +591,39 @@ shorter.</para>
           <indexterm><primary><option>-dsuppress-module-prefixes</option></primary></indexterm>
         </term>
        <listitem>
-          <para>Suppress the printing of module qualification prefixes in Core dumps to make them easier to read.</para>
+          <para>Suppress the printing of module qualification prefixes.
+               This is the <constant>Data.List</constant> in <constant>Data.List.length</constant>.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term>
-          <option>-dppr-user-length</option>
-          <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
+          <option>-dsuppress-type-signatures</option>
+          <indexterm><primary><option>-dsuppress-type-signatures</option></primary></indexterm>
         </term>
        <listitem>
-         <para>In error messages, expressions are printed to a
-         certain &ldquo;depth&rdquo;, with subexpressions beyond the
-         depth replaced by ellipses.  This flag sets the
-         depth.  Its default value is 5.</para>
+          <para>Suppress the printing of type signatures.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
-        <term>
-          <option>-dno-debug-output</option>
-          <indexterm><primary><option>-dno-debug-output</option></primary></indexterm>
+       <term>
+          <option>-dsuppress-type-applications</option>
+          <indexterm><primary><option>-dsuppress-type-applications</option></primary></indexterm>
         </term>
-        <listitem>
-          <para>Suppress any unsolicited debugging output.  When GHC
-            has been built with the <literal>DEBUG</literal> 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.</para>
-        </listitem>
+       <listitem>
+          <para>Suppress the printing of type applications.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dsuppress-coercions</option>
+          <indexterm><primary><option>-dsuppress-coercions</option></primary></indexterm>
+        </term>
+       <listitem>
+          <para>Suppress the printing of type coercions.</para>
+       </listitem>
       </varlistentry>
     </variablelist>
   </sect2>
index 26ab9eb..73faae7 100644 (file)
@@ -2468,32 +2468,68 @@ phase <replaceable>n</replaceable></entry>
              <entry>-</entry>
            </row>
            <row>
+             <entry><option>-dppr-noprags</option></entry>
+             <entry>Don't output pragma info in dumps</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
+             <entry><option>-dppr-user-length</option></entry>
+             <entry>Set the depth for printing expressions in error msgs</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
+             <entry><option>-dppr-colsNNN</option></entry>
+             <entry>Set the width of debugging output. For example <option>-dppr-cols200</option></entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
+             <entry><option>-dppr-case-as-let</option></entry>
+             <entry>Print single alternative case expressions as strict lets.</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
+             <entry><option>-dsuppress-all</option></entry>
+             <entry>In core dumps, suppress everything that is suppressable.</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
              <entry><option>-dsuppress-uniques</option></entry>
-             <entry>Suppress the printing of uniques in debug output (easier to use <command>diff</command>.</entry>
+             <entry>Suppress the printing of uniques in debug output (easier to use <command>diff</command>)</entry>
              <entry>static</entry>
              <entry>-</entry>
            </row>
            <row>
-             <entry><option>-dsuppress-coercions</option></entry>
-             <entry>Suppress the printing of coercions in Core dumps to make them shorter.</entry>
+             <entry><option>-dsuppress-idinfo</option></entry>
+             <entry>Suppress extended information about identifiers where they are bound</entry>
              <entry>static</entry>
              <entry>-</entry>
            </row>
            <row>
              <entry><option>-dsuppress-module-prefixes</option></entry>
-             <entry>Suppress the printing of module qualification prefixes in Core dumps to make them easier to read.</entry>
+             <entry>Suppress the printing of module qualification prefixes</entry>
              <entry>static</entry>
              <entry>-</entry>
            </row>
            <row>
-             <entry><option>-dppr-noprags</option></entry>
-             <entry>Don't output pragma info in dumps</entry>
+             <entry><option>-dsuppress-type-signatures</option></entry>
+             <entry>Suppress type signatures</entry>
              <entry>static</entry>
              <entry>-</entry>
            </row>
            <row>
-             <entry><option>-dppr-user-length</option></entry>
-             <entry>Set the depth for printing expressions in error msgs</entry>
+             <entry><option>-dsuppress-type-applications</option></entry>
+             <entry>Suppress type applications</entry>
+             <entry>static</entry>
+             <entry>-</entry>
+           </row>
+           <row>
+             <entry><option>-dsuppress-coercions</option></entry>
+             <entry>Suppress the printing of coercions in Core dumps to make them shorter</entry>
              <entry>static</entry>
              <entry>-</entry>
            </row>