5f46a06e3993e0f8909b9776dafe740ce1904ed8
[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-uncovered-patterns=⟨n⟩"
182 , flagDescription =
183 "*default: 4.* Set the maximum number of patterns to display in "++
184 "warnings about non-exhaustive ones."
185 , flagType = DynamicFlag
186 }
187 , flag { flagName = "-fmax-simplifier-iterations=⟨n⟩"
188 , flagDescription =
189 "*default: 4.* Set the max iterations for the simplifier."
190 , flagType = DynamicFlag
191 }
192 , flag { flagName = "-fmax-worker-args=⟨n⟩"
193 , flagDescription =
194 "*default: 10.* If a worker has that many arguments, none will "++
195 "be unpacked anymore."
196 , flagType = DynamicFlag
197 }
198 , flag { flagName = "-fno-opt-coercion"
199 , flagDescription = "Turn off the coercion optimiser"
200 , flagType = StaticFlag
201 }
202 , flag { flagName = "-fno-pre-inlining"
203 , flagDescription = "Turn off pre-inlining"
204 , flagType = DynamicFlag
205 }
206 , flag { flagName = "-fno-state-hack"
207 , flagDescription =
208 "Turn off the \"state hack\" whereby any lambda with a real-world "++
209 "state token as argument is considered to be single-entry. Hence "++
210 "OK to inline things inside it."
211 , flagType = StaticFlag
212 }
213 , flag { flagName = "-fomit-interface-pragmas"
214 , flagDescription =
215 "Don't generate interface pragmas. Implied by :ghc-flag:`O0` only."
216 , flagType = DynamicFlag
217 , flagReverse = "-fno-omit-interface-pragmas"
218 }
219 , flag { flagName = "-fomit-yields"
220 , flagDescription =
221 "Omit heap checks when no allocation is being performed."
222 , flagType = DynamicFlag
223 , flagReverse = "-fno-omit-yields"
224 }
225 , flag { flagName = "-foptimal-applicative-do"
226 , flagDescription =
227 "Use a slower but better algorithm for ApplicativeDo"
228 , flagType = DynamicFlag
229 , flagReverse = "-fno-optimal-applicative-do"
230 }
231 , flag { flagName = "-fpedantic-bottoms"
232 , flagDescription =
233 "Make GHC be more precise about its treatment of bottom (but see "++
234 "also :ghc-flag:`fno-state-hack`). In particular, GHC will not "++
235 "eta-expand through a case expression."
236 , flagType = DynamicFlag
237 , flagReverse = "-fno-pedantic-bottoms"
238 }
239 , flag { flagName = "-fregs-graph"
240 , flagDescription =
241 "Use the graph colouring register allocator for register "++
242 "allocation in the native code generator. Implied by :ghc-flag:`O2`."
243 , flagType = DynamicFlag
244 , flagReverse = "-fno-regs-graph"
245 }
246 , flag { flagName = "-fregs-iterative"
247 , flagDescription =
248 "Use the iterative coalescing graph colouring register allocator "++
249 "in the native code generator."
250 , flagType = DynamicFlag
251 , flagReverse = "-fno-regs-iterative"
252 }
253 , flag { flagName = "-fsimplifier-phases=⟨n⟩"
254 , flagDescription =
255 "*default: 2.* Set the number of phases for the simplifier. "++
256 "Ignored with :ghc-flag:`O0`."
257 , flagType = DynamicFlag
258 }
259 , flag { flagName = "-fsimpl-tick-factor=⟨n⟩"
260 , flagDescription =
261 "*default: 100.* Set the percentage factor for simplifier ticks."
262 , flagType = DynamicFlag
263 }
264 , flag { flagName = "-fspec-constr"
265 , flagDescription =
266 "Turn on the SpecConstr transformation. Implied by :ghc-flag:`O2`."
267 , flagType = DynamicFlag
268 , flagReverse = "-fno-spec-constr"
269 }
270 , flag { flagName = "-fspec-constr-count=⟨n⟩"
271 , flagDescription =
272 "default: 3.* Set to ⟨n⟩ the maximum number of specialisations that"++
273 " will be created for any one function by the SpecConstr "++
274 "transformation."
275 , flagType = DynamicFlag
276 , flagReverse = "-fno-spec-constr-count"
277 }
278 , flag { flagName = "-fspec-constr-threshold=⟨n⟩"
279 , flagDescription =
280 "*default: 2000.* Set the size threshold for the SpecConstr "++
281 "transformation to ⟨n⟩."
282 , flagType = DynamicFlag
283 , flagReverse = "-fno-spec-constr-threshold"
284 }
285 , flag { flagName = "-fspecialise"
286 , flagDescription =
287 "Turn on specialisation of overloaded functions. Implied by :ghc-flag:`O`."
288 , flagType = DynamicFlag
289 , flagReverse = "-fno-specialise"
290 }
291 , flag { flagName = "-fcross-module-specialise"
292 , flagDescription =
293 "Turn on specialisation of overloaded functions imported from "++
294 "other modules."
295 , flagType = DynamicFlag
296 , flagReverse = "-fno-cross-module-specialise"
297 }
298 , flag { flagName = "-fstatic-argument-transformation"
299 , flagDescription = "Turn on the static argument transformation."
300 , flagType = DynamicFlag
301 , flagReverse = "-fno-static-argument-transformation"
302 }
303 , flag { flagName = "-fstrictness"
304 , flagDescription = "Turn on strictness analysis." ++
305 " Implied by :ghc-flag:`O`. Implies :ghc-flag:`fworker-wrapper`"
306 , flagType = DynamicFlag
307 , flagReverse = "-fno-strictness"
308 }
309 , flag { flagName = "-fstrictness-before=⟨n⟩"
310 , flagDescription =
311 "Run an additional strictness analysis before simplifier phase ⟨n⟩"
312 , flagType = DynamicFlag
313 }
314 , flag { flagName = "-funbox-small-strict-fields"
315 , flagDescription =
316 "Flatten strict constructor fields with a pointer-sized "++
317 "representation. Implied by :ghc-flag:`O`."
318 , flagType = DynamicFlag
319 , flagReverse = "-fno-unbox-small-strict-fields"
320 }
321 , flag { flagName = "-funbox-strict-fields"
322 , flagDescription = "Flatten strict constructor fields"
323 , flagType = DynamicFlag
324 , flagReverse = "-fno-unbox-strict-fields"
325 }
326 , flag { flagName = "-funfolding-creation-threshold=⟨n⟩"
327 , flagDescription = "*default: 750.* Tweak unfolding settings."
328 , flagType = DynamicFlag
329 }
330 , flag { flagName = "-funfolding-dict-discount=⟨n⟩"
331 , flagDescription = "*default: 30.* Tweak unfolding settings."
332 , flagType = DynamicFlag
333 }
334 , flag { flagName = "-funfolding-fun-discount=⟨n⟩"
335 , flagDescription = "*default: 60.* Tweak unfolding settings."
336 , flagType = DynamicFlag
337 }
338 , flag { flagName = "-funfolding-keeness-factor=⟨n⟩"
339 , flagDescription = "*default: 1.5.* Tweak unfolding settings."
340 , flagType = DynamicFlag
341 }
342 , flag { flagName = "-funfolding-use-threshold=⟨n⟩"
343 , flagDescription = "*default: 60.* Tweak unfolding settings."
344 , flagType = DynamicFlag
345 }
346 , flag { flagName = "-fvectorisation-avoidance"
347 , flagDescription =
348 "Enable vectorisation avoidance. Always enabled by default."
349 , flagType = DynamicFlag
350 , flagReverse = "-fno-vectorisation-avoidance"
351 }
352 , flag { flagName = "-fvectorise"
353 , flagDescription = "Enable vectorisation of nested data parallelism"
354 , flagType = DynamicFlag
355 , flagReverse = "-fno-vectorise"
356 }
357 , flag { flagName = "-fworker-wrapper"
358 , flagDescription =
359 "Enable the worker-wrapper transformation after a strictness" ++
360 " analysis pass. Implied by :ghc-flag:`O`, and by :ghc-flag:`fstrictness`." ++
361 " Disabled by :ghc-flag:`fno-strictness`. Enabling :ghc-flag:`fworker-wrapper`" ++
362 " while strictness analysis is disabled (by :ghc-flag:`fno-strictness`)" ++
363 " has no effect."
364 , flagType = DynamicFlag
365 , flagReverse = "-fno-worker-wrapper"
366 }
367 ]