Add -foptimal-applicative-do
[ghc.git] / utils / mkUserGuidePart / Options / Optimizations.hs
1 module Options.Optimizations where
2
3 import Types
4
5 optimizationsOptions :: [Flag]
6 optimizationsOptions =
7 [ flag { flagName = "-fcall-arity"
8 , flagDescription =
9 "Enable call-arity optimisation. Implied by :ghc-flag:`O`."
10 , flagType = DynamicFlag
11 , flagReverse = "-fno-call-arity"
12 }
13 , flag { flagName = "-fcase-merge"
14 , flagDescription = "Enable case-merging. Implied by :ghc-flag:`O`."
15 , flagType = DynamicFlag
16 , flagReverse = "-fno-case-merge"
17 }
18 , flag { flagName = "-fcmm-elim-common-blocks"
19 , flagDescription =
20 "Enable Cmm common block elimination. Implied by :ghc-flag:`O`."
21 , flagType = DynamicFlag
22 , flagReverse = "-fno-cmm-elim-common-blocks"
23 }
24 , flag { flagName = "-fcmm-sink"
25 , flagDescription = "Enable Cmm sinking. Implied by :ghc-flag:`O`."
26 , flagType = DynamicFlag
27 , flagReverse = "-fno-cmm-sink"
28 }
29 , flag { flagName = "-fcpr-anal"
30 , flagDescription =
31 "Turn on CPR analysis in the demand analyser. Implied by :ghc-flag:`O`."
32 , flagType = DynamicFlag
33 , flagReverse = "-fno-cpr-anal"
34 }
35 , flag { flagName = "-fcse"
36 , flagDescription =
37 "Enable common sub-expression elimination. Implied by :ghc-flag:`O`."
38 , flagType = DynamicFlag
39 , flagReverse = "-fno-cse"
40 }
41 , flag { flagName = "-fdicts-cheap"
42 , flagDescription =
43 "Make dictionary-valued expressions seem cheap to the optimiser."
44 , flagType = DynamicFlag
45 , flagReverse = "-fno-dicts-cheap"
46 }
47 , flag { flagName = "-fdicts-strict"
48 , flagDescription = "Make dictionaries strict"
49 , flagType = DynamicFlag
50 , flagReverse = "-fno-dicts-strict"
51 }
52 , flag { flagName = "-fdmd-tx-dict-sel"
53 , flagDescription =
54 "Use a special demand transformer for dictionary selectors. "++
55 "Always enabled by default."
56 , flagType = DynamicFlag
57 , flagReverse = "-fno-dmd-tx-dict-sel"
58 }
59 , flag { flagName = "-fdo-eta-reduction"
60 , flagDescription = "Enable eta-reduction. Implied by :ghc-flag:`O`."
61 , flagType = DynamicFlag
62 , flagReverse = "-fno-do-eta-reduction"
63 }
64 , flag { flagName = "-fdo-lambda-eta-expansion"
65 , flagDescription =
66 "Enable lambda eta-expansion. Always enabled by default."
67 , flagType = DynamicFlag
68 , flagReverse = "-fno-do-lambda-eta-expansion"
69 }
70 , flag { flagName = "-feager-blackholing"
71 , flagDescription =
72 "Turn on :ref:`eager blackholing <parallel-compile-options>`"
73 , flagType = DynamicFlag
74 }
75 , flag { flagName = "-fenable-rewrite-rules"
76 , flagDescription =
77 "Switch on all rewrite rules (including rules generated by "++
78 "automatic specialisation of overloaded functions). Implied by "++
79 ":ghc-flag:`O`."
80 , flagType = DynamicFlag
81 , flagReverse = "-fno-enable-rewrite-rules"
82 }
83 , flag { flagName = "-fexcess-precision"
84 , flagDescription = "Enable excess intermediate precision"
85 , flagType = DynamicFlag
86 , flagReverse = "-fno-excess-precision"
87 }
88 , flag { flagName = "-fexpose-all-unfoldings"
89 , flagDescription =
90 "Expose all unfoldings, even for very large or recursive functions."
91 , flagType = DynamicFlag
92 , flagReverse = "-fno-expose-all-unfoldings"
93 }
94 , flag { flagName = "-ffloat-in"
95 , flagDescription =
96 "Turn on the float-in transformation. Implied by :ghc-flag:`O`."
97 , flagType = DynamicFlag
98 , flagReverse = "-fno-float-in"
99 }
100 , flag { flagName = "-ffull-laziness"
101 , flagDescription =
102 "Turn on full laziness (floating bindings outwards). "++
103 "Implied by :ghc-flag:`O`."
104 , flagType = DynamicFlag
105 , flagReverse = "-fno-full-laziness"
106 }
107 , flag { flagName = "-ffun-to-thunk"
108 , flagDescription =
109 "Allow worker-wrapper to convert a function closure into a thunk "++
110 "if the function does not use any of its arguments. Off by default."
111 , flagType = DynamicFlag
112 , flagReverse = "-fno-fun-to-thunk"
113 }
114 , flag { flagName = "-fignore-asserts"
115 , flagDescription =
116 "Ignore assertions in the source. Implied by :ghc-flag:`O`."
117 , flagType = DynamicFlag
118 , flagReverse = "-fno-ignore-asserts"
119 }
120 , flag { flagName = "-fignore-interface-pragmas"
121 , flagDescription =
122 "Ignore pragmas in interface files. Implied by :ghc-flag:`O0` only."
123 , flagType = DynamicFlag
124 , flagReverse = "-fno-ignore-interface-pragmas"
125 }
126 , flag { flagName = "-flate-dmd-anal"
127 , flagDescription =
128 "Run demand analysis again, at the end of the "++
129 "simplification pipeline"
130 , flagType = DynamicFlag
131 , flagReverse = "-fno-late-dmd-anal"
132 }
133 , flag { flagName = "-fliberate-case"
134 , flagDescription =
135 "Turn on the liberate-case transformation. Implied by :ghc-flag:`O2`."
136 , flagType = DynamicFlag
137 , flagReverse = "-fno-liberate-case"
138 }
139 , flag { flagName = "-fliberate-case-threshold=⟨n⟩"
140 , flagDescription =
141 "*default: 2000.* Set the size threshold for the liberate-case "++
142 "transformation to ⟨n⟩"
143 , flagType = DynamicFlag
144 , flagReverse = "-fno-liberate-case-threshold"
145 }
146 , flag { flagName = "-floopification"
147 , flagDescription =
148 "Turn saturated self-recursive tail-calls into local jumps in the "++
149 "generated assembly. Implied by :ghc-flag:`O`."
150 , flagType = DynamicFlag
151 , flagReverse = "-fno-loopification"
152 }
153 , flag { flagName = "-fmax-inline-alloc-size=⟨n⟩"
154 , flagDescription =
155 "*default: 128.* Set the maximum size of inline array allocations "++
156 "to ⟨n⟩ bytes (default: 128). GHC will allocate non-pinned arrays "++
157 "of statically known size in the current nursery block if they're "++
158 "no bigger than ⟨n⟩ bytes, ignoring GC overheap. This value should "++
159 "be quite a bit smaller than the block size (typically: 4096)."
160 , flagType = DynamicFlag
161 }
162 , flag { flagName = "-fmax-inline-memcpy-insns=⟨n⟩"
163 , flagDescription =
164 "*default: 32.* Inline ``memcpy`` calls if they would generate no "++
165 "more than ⟨n⟩ pseudo instructions."
166 , flagType = DynamicFlag
167 }
168 , flag { flagName = "-fmax-inline-memset-insns=⟨n⟩"
169 , flagDescription =
170 "*default: 32.* Inline ``memset`` calls if they would generate no "++
171 "more than ⟨n⟩ pseudo instructions"
172 , flagType = DynamicFlag
173 }
174 , flag { flagName = "-fmax-relevant-binds=⟨n⟩"
175 , flagDescription =
176 "*default: 6.* Set the maximum number of bindings to display in "++
177 "type error messages."
178 , flagType = DynamicFlag
179 , flagReverse = "-fno-max-relevant-bindings"
180 }
181 , flag { flagName = "-fmax-simplifier-iterations=⟨n⟩"
182 , flagDescription =
183 "*default: 4.* Set the max iterations for the simplifier."
184 , flagType = DynamicFlag
185 }
186 , flag { flagName = "-fmax-worker-args=⟨n⟩"
187 , flagDescription =
188 "*default: 10.* If a worker has that many arguments, none will "++
189 "be unpacked anymore."
190 , flagType = DynamicFlag
191 }
192 , flag { flagName = "-fno-opt-coercion"
193 , flagDescription = "Turn off the coercion optimiser"
194 , flagType = StaticFlag
195 }
196 , flag { flagName = "-fno-pre-inlining"
197 , flagDescription = "Turn off pre-inlining"
198 , flagType = DynamicFlag
199 }
200 , flag { flagName = "-fno-state-hack"
201 , flagDescription =
202 "Turn off the \"state hack\" whereby any lambda with a real-world "++
203 "state token as argument is considered to be single-entry. Hence "++
204 "OK to inline things inside it."
205 , flagType = StaticFlag
206 }
207 , flag { flagName = "-fomit-interface-pragmas"
208 , flagDescription =
209 "Don't generate interface pragmas. Implied by :ghc-flag:`O0` only."
210 , flagType = DynamicFlag
211 , flagReverse = "-fno-omit-interface-pragmas"
212 }
213 , flag { flagName = "-fomit-yields"
214 , flagDescription =
215 "Omit heap checks when no allocation is being performed."
216 , flagType = DynamicFlag
217 , flagReverse = "-fno-omit-yields"
218 }
219 , flag { flagName = "-foptimal-applicative-do"
220 , flagDescription =
221 "Use a slower but better algorithm for ApplicativeDo"
222 , flagType = DynamicFlag
223 , flagReverse = "-fno-optimal-applicative-do"
224 }
225 , flag { flagName = "-fpedantic-bottoms"
226 , flagDescription =
227 "Make GHC be more precise about its treatment of bottom (but see "++
228 "also :ghc-flag:`fno-state-hack`). In particular, GHC will not "++
229 "eta-expand through a case expression."
230 , flagType = DynamicFlag
231 , flagReverse = "-fno-pedantic-bottoms"
232 }
233 , flag { flagName = "-fregs-graph"
234 , flagDescription =
235 "Use the graph colouring register allocator for register "++
236 "allocation in the native code generator. Implied by :ghc-flag:`O2`."
237 , flagType = DynamicFlag
238 , flagReverse = "-fno-regs-graph"
239 }
240 , flag { flagName = "-fregs-iterative"
241 , flagDescription =
242 "Use the iterative coalescing graph colouring register allocator "++
243 "in the native code generator."
244 , flagType = DynamicFlag
245 , flagReverse = "-fno-regs-iterative"
246 }
247 , flag { flagName = "-fsimplifier-phases=⟨n⟩"
248 , flagDescription =
249 "*default: 2.* Set the number of phases for the simplifier. "++
250 "Ignored with :ghc-flag:`O0`."
251 , flagType = DynamicFlag
252 }
253 , flag { flagName = "-fsimpl-tick-factor=⟨n⟩"
254 , flagDescription =
255 "*default: 100.* Set the percentage factor for simplifier ticks."
256 , flagType = DynamicFlag
257 }
258 , flag { flagName = "-fspec-constr"
259 , flagDescription =
260 "Turn on the SpecConstr transformation. Implied by :ghc-flag:`O2`."
261 , flagType = DynamicFlag
262 , flagReverse = "-fno-spec-constr"
263 }
264 , flag { flagName = "-fspec-constr-count=⟨n⟩"
265 , flagDescription =
266 "default: 3.* Set to ⟨n⟩ the maximum number of specialisations that"++
267 " will be created for any one function by the SpecConstr "++
268 "transformation."
269 , flagType = DynamicFlag
270 , flagReverse = "-fno-spec-constr-count"
271 }
272 , flag { flagName = "-fspec-constr-threshold=⟨n⟩"
273 , flagDescription =
274 "*default: 2000.* Set the size threshold for the SpecConstr "++
275 "transformation to ⟨n⟩."
276 , flagType = DynamicFlag
277 , flagReverse = "-fno-spec-constr-threshold"
278 }
279 , flag { flagName = "-fspecialise"
280 , flagDescription =
281 "Turn on specialisation of overloaded functions. Implied by :ghc-flag:`O`."
282 , flagType = DynamicFlag
283 , flagReverse = "-fno-specialise"
284 }
285 , flag { flagName = "-fcross-module-specialise"
286 , flagDescription =
287 "Turn on specialisation of overloaded functions imported from "++
288 "other modules."
289 , flagType = DynamicFlag
290 , flagReverse = "-fno-cross-module-specialise"
291 }
292 , flag { flagName = "-fstatic-argument-transformation"
293 , flagDescription = "Turn on the static argument transformation."
294 , flagType = DynamicFlag
295 , flagReverse = "-fno-static-argument-transformation"
296 }
297 , flag { flagName = "-fstrictness"
298 , flagDescription = "Turn on strictness analysis." ++
299 " Implied by :ghc-flag:`O`. Implies :ghc-flag:`fworker-wrapper`"
300 , flagType = DynamicFlag
301 , flagReverse = "-fno-strictness"
302 }
303 , flag { flagName = "-fstrictness-before=⟨n⟩"
304 , flagDescription =
305 "Run an additional strictness analysis before simplifier phase ⟨n⟩"
306 , flagType = DynamicFlag
307 }
308 , flag { flagName = "-funbox-small-strict-fields"
309 , flagDescription =
310 "Flatten strict constructor fields with a pointer-sized "++
311 "representation. Implied by :ghc-flag:`O`."
312 , flagType = DynamicFlag
313 , flagReverse = "-fno-unbox-small-strict-fields"
314 }
315 , flag { flagName = "-funbox-strict-fields"
316 , flagDescription = "Flatten strict constructor fields"
317 , flagType = DynamicFlag
318 , flagReverse = "-fno-unbox-strict-fields"
319 }
320 , flag { flagName = "-funfolding-creation-threshold=⟨n⟩"
321 , flagDescription = "*default: 750.* Tweak unfolding settings."
322 , flagType = DynamicFlag
323 }
324 , flag { flagName = "-funfolding-dict-discount=⟨n⟩"
325 , flagDescription = "*default: 30.* Tweak unfolding settings."
326 , flagType = DynamicFlag
327 }
328 , flag { flagName = "-funfolding-fun-discount=⟨n⟩"
329 , flagDescription = "*default: 60.* Tweak unfolding settings."
330 , flagType = DynamicFlag
331 }
332 , flag { flagName = "-funfolding-keeness-factor=⟨n⟩"
333 , flagDescription = "*default: 1.5.* Tweak unfolding settings."
334 , flagType = DynamicFlag
335 }
336 , flag { flagName = "-funfolding-use-threshold=⟨n⟩"
337 , flagDescription = "*default: 60.* Tweak unfolding settings."
338 , flagType = DynamicFlag
339 }
340 , flag { flagName = "-fvectorisation-avoidance"
341 , flagDescription =
342 "Enable vectorisation avoidance. Always enabled by default."
343 , flagType = DynamicFlag
344 , flagReverse = "-fno-vectorisation-avoidance"
345 }
346 , flag { flagName = "-fvectorise"
347 , flagDescription = "Enable vectorisation of nested data parallelism"
348 , flagType = DynamicFlag
349 , flagReverse = "-fno-vectorise"
350 }
351 , flag { flagName = "-fworker-wrapper"
352 , flagDescription =
353 "Enable the worker-wrapper transformation after a strictness" ++
354 " analysis pass. Implied by :ghc-flag:`O`, and by :ghc-flag:`fstrictness`." ++
355 " Disabled by :ghc-flag:`fno-strictness`. Enabling :ghc-flag:`fworker-wrapper`" ++
356 " while strictness analysis is disabled (by :ghc-flag:`fno-strictness`)" ++
357 " has no effect."
358 , flagType = DynamicFlag
359 , flagReverse = "-fno-worker-wrapper"
360 }
361 ]