diff options
| author | Milan Straka <fox@ucw.cz> | 2010-03-31 19:10:50 +0000 |
|---|---|---|
| committer | Milan Straka <fox@ucw.cz> | 2010-03-31 19:10:50 +0000 |
| commit | 7be227dcf505a16b1b63a9fe3cbea87127b70b52 (patch) | |
| tree | d461f16612e48ad046c2997d0161f975a0052fe0 | |
| parent | 00022894bbb2dfa33fd213eedbac0f28b4c4b7b4 (diff) | |
| download | haskell-7be227dcf505a16b1b63a9fe3cbea87127b70b52.tar.gz | |
Flags -auto and -auto-all operate only on functions not marked INLINE.
| -rw-r--r-- | compiler/deSugar/DsBinds.lhs | 3 | ||||
| -rw-r--r-- | docs/users_guide/flags.xml | 4 | ||||
| -rw-r--r-- | docs/users_guide/profiling.xml | 16 |
3 files changed, 15 insertions, 8 deletions
diff --git a/compiler/deSugar/DsBinds.lhs b/compiler/deSugar/DsBinds.lhs index cc7ecfd38e..797d55e44e 100644 --- a/compiler/deSugar/DsBinds.lhs +++ b/compiler/deSugar/DsBinds.lhs @@ -633,6 +633,7 @@ See Note [Rules for seq] in MkId for the details. data AutoScc = NoSccs | AddSccs Module (Id -> Bool) -- The (Id->Bool) says which Ids to add SCCs to +-- But we never add a SCC to function marked INLINE addAutoScc :: AutoScc -> Id -- Binder @@ -641,6 +642,8 @@ addAutoScc :: AutoScc addAutoScc NoSccs _ rhs = rhs +addAutoScc _ id rhs | isInlinePragma (idInlinePragma id) + = rhs addAutoScc (AddSccs mod add_scc) id rhs | add_scc id = mkSCC (mkAutoCC id mod NotCafCC) rhs | otherwise = rhs diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index e7c237b513..1aec575f24 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -1543,14 +1543,14 @@ phase <replaceable>n</replaceable></entry> <row> <entry><option>-auto</option></entry> <entry>Auto-add <literal>_scc_</literal>s to all - exported functions</entry> + exported functions not marked INLINE</entry> <entry>dynamic</entry> <entry><option>-no-auto</option></entry> </row> <row> <entry><option>-auto-all</option></entry> <entry>Auto-add <literal>_scc_</literal>s to all - top-level functions</entry> + top-level functions not marked INLINE</entry> <entry>dynamic</entry> <entry><option>-no-auto-all</option></entry> </row> diff --git a/docs/users_guide/profiling.xml b/docs/users_guide/profiling.xml index 5fb53d038e..fe835afc9b 100644 --- a/docs/users_guide/profiling.xml +++ b/docs/users_guide/profiling.xml @@ -249,8 +249,8 @@ MAIN MAIN 0 0.0 0.0 100.0 100.0 <para>Cost centres are just program annotations. When you say <option>-auto-all</option> to the compiler, it automatically inserts a cost centre annotation around every top-level function - in your program, but you are entirely free to add the cost - centre annotations yourself.</para> + not marked INLINE in your program, but you are entirely free to + add the cost centre annotations yourself.</para> <para>The syntax of a cost centre annotation is</para> @@ -401,7 +401,9 @@ x = nfib 25 <listitem> <para> GHC will automatically add <function>_scc_</function> constructs for all - top-level, exported functions.</para> + top-level, exported functions not marked INLINE. If you + want a cost centre on an INLINE function, you have to add + it manually.</para> </listitem> </varlistentry> @@ -411,9 +413,11 @@ x = nfib 25 <indexterm><primary><option>-auto-all</option></primary></indexterm> </term> <listitem> - <para> <emphasis>All</emphasis> top-level functions, - exported or not, will be automatically - <function>_scc_</function>'d.</para> + <para> <emphasis>All</emphasis> top-level functions + not marked INLINE, exported or not, will be automatically + <function>_scc_</function>'d. + The functions marked INLINE must be given a cost centre + manually.</para> </listitem> </varlistentry> |
