Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
34728de0
Commit
34728de0
authored
Sep 04, 2013
by
nfrisby
Browse files
documentation and comments for -ffun-to-thunk and -flate-dmd-anal
parent
6fff2166
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler/stranal/WwLib.lhs
View file @
34728de0
...
...
@@ -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
the function from becoming a thunk.
The user can avoid that argument with the -ffun-to-thunk
flag. However, removing all the value argus may introduce space leaks.
The user can avoid adding the void argument with the -ffun-to-thunk
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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
docs/users_guide/flags.xml
View file @
34728de0
...
...
@@ -1585,17 +1585,6 @@
<entry><option>
-fno-dicts-strict
</option></entry>
</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>
<entry><option>
-fdo-eta-reduction
</option></entry>
<entry>
Enable eta-reduction. Implied by
<option>
-O
</option>
.
</entry>
...
...
@@ -1661,6 +1650,15 @@
<entry><option>
-fno-full-laziness
</option></entry>
</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>
<entry><option>
-fignore-asserts
</option></entry>
<entry>
Ignore assertions in the source
</entry>
...
...
@@ -1675,6 +1673,14 @@
<entry><option>
-fno-ignore-interface-pragmas
</option></entry>
</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>
<entry><option>
-fliberate-case
</option></entry>
<entry>
Turn on the liberate-case transformation. Implied by
<option>
-O2
</option>
.
</entry>
...
...
docs/users_guide/using.xml
View file @
34728de0
...
...
@@ -2095,16 +2095,15 @@ f "2" = 2
<varlistentry>
<term>
<option>
-
-
ffun-to-thunk
</option>
<option>
-ffun-to-thunk
</option>
<indexterm><primary><option>
-fignore-asserts
</option></primary></indexterm>
</term>
<listitem>
<para>
Worker-wrapper removes unused arguments, but usually we
do 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)
and/or a space leak. This flag
allows worker/wrapper to remove
<emphasis>
all
</emphasis>
value lambdas.
Off by default.
<para>
Worker-wrapper removes unused arguments, but usually we do
not remove them all, lest it turn a function closure into a thunk,
thereby perhaps creating a space leak and/or disrupting inlining.
This flag allows worker/wrapper to remove
<emphasis>
all
</emphasis>
value lambdas. Off by default.
</para>
</listitem>
</varlistentry>
...
...
@@ -2137,6 +2136,18 @@ f "2" = 2
</listitem>
</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>
<term>
<option>
-fliberate-case
</option>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment