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
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
<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>
<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>
<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>
<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>