Commit 34728de0 authored by nfrisby's avatar nfrisby

documentation and comments for -ffun-to-thunk and -flate-dmd-anal

parent 6fff2166
...@@ -214,8 +214,11 @@ the sharing of E. Since absence analysis and worker-wrapper are keen ...@@ -214,8 +214,11 @@ the sharing of E. Since absence analysis and worker-wrapper are keen
to remove such unused arguments, we add in a void argument to prevent to remove such unused arguments, we add in a void argument to prevent
the function from becoming a thunk. the function from becoming a thunk.
The user can avoid that argument with the -ffun-to-thunk The user can avoid adding the void argument with the -ffun-to-thunk
flag. However, removing all the value argus may introduce space leaks. flag. However, this can create sharing, which may be bad in two ways. 1) It can
create a space leak. 2) It can prevent inlining *under a lambda*. If w/w
removes the last argument from a function f, then f now looks like a thunk, and
so f can't be inlined *under a lambda*.
Note [All One-Shot Arguments of a Worker] Note [All One-Shot Arguments of a Worker]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -1585,17 +1585,6 @@ ...@@ -1585,17 +1585,6 @@
<entry><option>-fno-dicts-strict</option></entry> <entry><option>-fno-dicts-strict</option></entry>
</row> </row>
<row>
<entry><option>-ffun-to-thunk</option></entry>
<entry>Worker-wrapper removes unused arguments; this flag
lets it thusly remove all value lambdas. Doing so creates
a thunk where it was previously a function closure, which
may save recomputation but also risks a space leak. Off by
default.</entry>
<entry>dynamic</entry>
<entry><option>-fno-fun-to-thunk</option></entry>
</row>
<row> <row>
<entry><option>-fdo-eta-reduction</option></entry> <entry><option>-fdo-eta-reduction</option></entry>
<entry>Enable eta-reduction. Implied by <option>-O</option>.</entry> <entry>Enable eta-reduction. Implied by <option>-O</option>.</entry>
...@@ -1661,6 +1650,15 @@ ...@@ -1661,6 +1650,15 @@
<entry><option>-fno-full-laziness</option></entry> <entry><option>-fno-full-laziness</option></entry>
</row> </row>
<row>
<entry><option>-ffun-to-thunk</option></entry>
<entry>Allow worker-wrapper to convert a function closure into a
thunk if the function does not use any of its arguments. Off by
default.</entry>
<entry>dynamic</entry>
<entry><option>-fno-fun-to-thunk</option></entry>
</row>
<row> <row>
<entry><option>-fignore-asserts</option></entry> <entry><option>-fignore-asserts</option></entry>
<entry>Ignore assertions in the source</entry> <entry>Ignore assertions in the source</entry>
...@@ -1675,6 +1673,14 @@ ...@@ -1675,6 +1673,14 @@
<entry><option>-fno-ignore-interface-pragmas</option></entry> <entry><option>-fno-ignore-interface-pragmas</option></entry>
</row> </row>
<row>
<entry><option>-flate-dmd-anal</option></entry>
<entry>Run demand analysis again, at the end of the simplification
pipeline</entry>
<entry>dynamic</entry>
<entry><option>-fno-late-dmd-anal</option></entry>
</row>
<row> <row>
<entry><option>-fliberate-case</option></entry> <entry><option>-fliberate-case</option></entry>
<entry>Turn on the liberate-case transformation. Implied by <option>-O2</option>.</entry> <entry>Turn on the liberate-case transformation. Implied by <option>-O2</option>.</entry>
......
...@@ -2095,16 +2095,15 @@ f "2" = 2 ...@@ -2095,16 +2095,15 @@ f "2" = 2
<varlistentry> <varlistentry>
<term> <term>
<option>--ffun-to-thunk</option> <option>-ffun-to-thunk</option>
<indexterm><primary><option>-fignore-asserts</option></primary></indexterm> <indexterm><primary><option>-fignore-asserts</option></primary></indexterm>
</term> </term>
<listitem> <listitem>
<para>Worker-wrapper removes unused arguments, but usually we <para>Worker-wrapper removes unused arguments, but usually we do
do not remove them all, lest it turn a function closure into a thunk, not remove them all, lest it turn a function closure into a thunk,
thereby perhaps causing extra allocation (since let-no-escape can't happen) thereby perhaps creating a space leak and/or disrupting inlining.
and/or a space leak. This flag This flag allows worker/wrapper to remove <emphasis>all</emphasis>
allows worker/wrapper to remove <emphasis>all</emphasis> value lambdas. value lambdas. Off by default.
Off by default.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -2137,6 +2136,18 @@ f "2" = 2 ...@@ -2137,6 +2136,18 @@ f "2" = 2
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>-flate-dmd-anal</option>
<indexterm><primary><option>-flate-dmd-anal</option></primary></indexterm>
</term>
<listitem>
<para><emphasis>Off by default.</emphasis>Run demand analysis
again, at the end of the simplification pipeline
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>-fliberate-case</option> <option>-fliberate-case</option>
......
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