summaryrefslogtreecommitdiff
path: root/utils/mkUserGuidePart/Options/Optimizations.hs
blob: 0082a210fb5d4c40e55d17746686809c14af2ecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
module Options.Optimizations where

import Types

optimizationsOptions :: [Flag]
optimizationsOptions =
  [ flag { flagName = "-fcall-arity"
         , flagDescription =
           "Enable call-arity optimisation. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-call-arity"
         }
  , flag { flagName = "-fcase-merge"
         , flagDescription = "Enable case-merging. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-case-merge"
         }
  , flag { flagName = "-fcmm-elim-common-blocks"
         , flagDescription =
           "Enable Cmm common block elimination. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-cmm-elim-common-blocks"
         }
  , flag { flagName = "-fcmm-sink"
         , flagDescription = "Enable Cmm sinking. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-cmm-sink"
         }
  , flag { flagName = "-fcpr-anal"
         , flagDescription =
           "Turn on CPR analysis in the demand analyser. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-cpr-anal"
         }
  , flag { flagName = "-fcse"
         , flagDescription =
           "Enable common sub-expression elimination. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-cse"
         }
  , flag { flagName = "-fdicts-cheap"
         , flagDescription =
           "Make dictionary-valued expressions seem cheap to the optimiser."
         , flagType = DynamicFlag
         , flagReverse = "-fno-dicts-cheap"
         }
  , flag { flagName = "-fdicts-strict"
         , flagDescription = "Make dictionaries strict"
         , flagType = DynamicFlag
         , flagReverse = "-fno-dicts-strict"
         }
  , flag { flagName = "-fdmd-tx-dict-sel"
         , flagDescription =
           "Use a special demand transformer for dictionary selectors. "++
           "Always enabled by default."
         , flagType = DynamicFlag
         , flagReverse = "-fno-dmd-tx-dict-sel"
         }
  , flag { flagName = "-fdo-eta-reduction"
         , flagDescription = "Enable eta-reduction. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-do-eta-reduction"
         }
  , flag { flagName = "-fdo-lambda-eta-expansion"
         , flagDescription =
           "Enable lambda eta-expansion. Always enabled by default."
         , flagType = DynamicFlag
         , flagReverse = "-fno-do-lambda-eta-expansion"
         }
  , flag { flagName = "-feager-blackholing"
         , flagDescription =
           "Turn on :ref:`eager blackholing <parallel-compile-options>`"
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fenable-rewrite-rules"
         , flagDescription =
           "Switch on all rewrite rules (including rules generated by "++
           "automatic specialisation of overloaded functions). Implied by "++
           "``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-enable-rewrite-rules"
         }
  , flag { flagName = "-fexcess-precision"
         , flagDescription = "Enable excess intermediate precision"
         , flagType = DynamicFlag
         , flagReverse = "-fno-excess-precision"
         }
  , flag { flagName = "-fexpose-all-unfoldings"
         , flagDescription =
           "Expose all unfoldings, even for very large or recursive functions."
         , flagType = DynamicFlag
         , flagReverse = "-fno-expose-all-unfoldings"
         }
  , flag { flagName = "-ffloat-in"
         , flagDescription =
           "Turn on the float-in transformation. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-float-in"
         }
  , flag { flagName = "-ffull-laziness"
         , flagDescription =
           "Turn on full laziness (floating bindings outwards). "++
           "Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-full-laziness"
         }
  , flag { flagName = "-ffun-to-thunk"
         , flagDescription =
           "Allow worker-wrapper to convert a function closure into a thunk "++
           "if the function does not use any of its arguments. Off by default."
         , flagType = DynamicFlag
         , flagReverse = "-fno-fun-to-thunk"
         }
  , flag { flagName = "-fignore-asserts"
         , flagDescription =
           "Ignore assertions in the source. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-ignore-asserts"
         }
  , flag { flagName = "-fignore-interface-pragmas"
         , flagDescription =
           "Ignore pragmas in interface files. Implied by ``-O0`` only."
         , flagType = DynamicFlag
         , flagReverse = "-fno-ignore-interface-pragmas"
         }
  , flag { flagName = "-flate-dmd-anal"
         , flagDescription =
           "Run demand analysis again, at the end of the "++
           "simplification pipeline"
         , flagType = DynamicFlag
         , flagReverse = "-fno-late-dmd-anal"
         }
  , flag { flagName = "-fliberate-case"
         , flagDescription =
           "Turn on the liberate-case transformation. Implied by ``-O2``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-liberate-case"
         }
  , flag { flagName = "-fliberate-case-threshold=⟨n⟩"
         , flagDescription =
           "*default: 2000.* Set the size threshold for the liberate-case "++
           "transformation to ⟨n⟩"
         , flagType = DynamicFlag
         , flagReverse = "-fno-liberate-case-threshold"
         }
  , flag { flagName = "-floopification"
         , flagDescription =
           "Turn saturated self-recursive tail-calls into local jumps in the "++
           "generated assembly. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-loopification"
         }
  , flag { flagName = "-fmax-inline-alloc-size=⟨n⟩"
         , flagDescription =
           "*default: 128.* Set the maximum size of inline array allocations "++
           "to ⟨n⟩ bytes (default: 128). GHC will allocate non-pinned arrays "++
           "of statically known size in the current nursery block if they're "++
           "no bigger than ⟨n⟩ bytes, ignoring GC overheap. This value should "++
           "be quite a bit smaller than the block size (typically: 4096)."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fmax-inline-memcpy-insns=⟨n⟩"
         , flagDescription =
           "*default: 32.* Inline ``memcpy`` calls if they would generate no "++
           "more than ⟨n⟩ pseudo instructions."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fmax-inline-memset-insns=⟨n⟩"
         , flagDescription =
           "*default: 32.* Inline ``memset`` calls if they would generate no "++
           "more than ⟨n⟩ pseudo instructions"
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fmax-relevant-binds=⟨n⟩"
         , flagDescription =
           "*default: 6.* Set the maximum number of bindings to display in "++
           "type error messages."
         , flagType = DynamicFlag
         , flagReverse = "-fno-max-relevant-bindings"
         }
  , flag { flagName = "-fmax-simplifier-iterations=⟨n⟩"
         , flagDescription =
           "*default: 4.* Set the max iterations for the simplifier."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fmax-worker-args=⟨n⟩"
         , flagDescription =
           "*default: 10.* If a worker has that many arguments, none will "++
           "be unpacked anymore."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fno-opt-coercion"
         , flagDescription = "Turn off the coercion optimiser"
         , flagType = StaticFlag
         }
  , flag { flagName = "-fno-pre-inlining"
         , flagDescription = "Turn off pre-inlining"
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fno-state-hack"
         , flagDescription =
           "Turn off the \"state hack\" whereby any lambda with a real-world "++
           "state token as argument is considered to be single-entry. Hence "++
           "OK to inline things inside it."
         , flagType = StaticFlag
         }
  , flag { flagName = "-fomit-interface-pragmas"
         , flagDescription =
           "Don't generate interface pragmas. Implied by ``-O0`` only."
         , flagType = DynamicFlag
         , flagReverse = "-fno-omit-interface-pragmas"
         }
  , flag { flagName = "-fomit-yields"
         , flagDescription =
           "Omit heap checks when no allocation is being performed."
         , flagType = DynamicFlag
         , flagReverse = "-fno-omit-yields"
         }
  , flag { flagName = "-fpedantic-bottoms"
         , flagDescription =
           "Make GHC be more precise about its treatment of bottom (but see "++
           "also ``-fno-state-hack``). In particular, GHC will not "++
           "eta-expand through a case expression."
         , flagType = DynamicFlag
         , flagReverse = "-fno-pedantic-bottoms"
         }
  , flag { flagName = "-fregs-graph"
         , flagDescription =
           "Use the graph colouring register allocator for register "++
           "allocation in the native code generator. Implied by ``-O2``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-regs-graph"
         }
  , flag { flagName = "-fregs-iterative"
         , flagDescription =
           "Use the iterative coalescing graph colouring register allocator "++
           "in the native code generator."
         , flagType = DynamicFlag
         , flagReverse = "-fno-regs-iterative"
         }
  , flag { flagName = "-fsimplifier-phases=⟨n⟩"
         , flagDescription =
           "*default: 2.* Set the number of phases for the simplifier. "++
           "Ignored with ``-O0``."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fsimpl-tick-factor=⟨n⟩"
         , flagDescription =
           "*default: 100.* Set the percentage factor for simplifier ticks."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fspec-constr"
         , flagDescription =
           "Turn on the SpecConstr transformation. Implied by ``-O2``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-spec-constr"
         }
  , flag { flagName = "-fspec-constr-count=⟨n⟩"
         , flagDescription =
           "default: 3.* Set to ⟨n⟩ the maximum number of specialisations that"++
           " will be created for any one function by the SpecConstr "++
           "transformation."
         , flagType = DynamicFlag
         , flagReverse = "-fno-spec-constr-count"
         }
  , flag { flagName = "-fspec-constr-threshold=⟨n⟩"
         , flagDescription =
           "*default: 2000.* Set the size threshold for the SpecConstr "++
           "transformation to ⟨n⟩."
         , flagType = DynamicFlag
         , flagReverse = "-fno-spec-constr-threshold"
         }
  , flag { flagName = "-fspecialise"
         , flagDescription =
           "Turn on specialisation of overloaded functions. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-specialise"
         }
  , flag { flagName = "-fcross-module-specialise"
         , flagDescription =
           "Turn on specialisation of overloaded functions imported from "++
           "other modules."
         , flagType = DynamicFlag
         , flagReverse = "-fno-cross-module-specialise"
         }
  , flag { flagName = "-fstatic-argument-transformation"
         , flagDescription = "Turn on the static argument transformation."
         , flagType = DynamicFlag
         , flagReverse = "-fno-static-argument-transformation"
         }
  , flag { flagName = "-fstrictness"
         , flagDescription = "Turn on strictness analysis. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-strictness"
         }
  , flag { flagName = "-fstrictness-before=⟨n⟩"
         , flagDescription =
           "Run an additional strictness analysis before simplifier phase ⟨n⟩"
         , flagType = DynamicFlag
         }
  , flag { flagName = "-funbox-small-strict-fields"
         , flagDescription =
           "Flatten strict constructor fields with a pointer-sized "++
           "representation. Implied by ``-O``."
         , flagType = DynamicFlag
         , flagReverse = "-fno-unbox-small-strict-fields"
         }
  , flag { flagName = "-funbox-strict-fields"
         , flagDescription = "Flatten strict constructor fields"
         , flagType = DynamicFlag
         , flagReverse = "-fno-unbox-strict-fields"
         }
  , flag { flagName = "-funfolding-creation-threshold=⟨n⟩"
         , flagDescription = "*default: 750.* Tweak unfolding settings."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-funfolding-dict-discount=⟨n⟩"
         , flagDescription = "*default: 30.* Tweak unfolding settings."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-funfolding-fun-discount=⟨n⟩"
         , flagDescription = "*default: 60.* Tweak unfolding settings."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-funfolding-keeness-factor=⟨n⟩"
         , flagDescription = "*default: 1.5.* Tweak unfolding settings."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-funfolding-use-threshold=⟨n⟩"
         , flagDescription = "*default: 60.* Tweak unfolding settings."
         , flagType = DynamicFlag
         }
  , flag { flagName = "-fvectorisation-avoidance"
         , flagDescription =
           "Enable vectorisation avoidance. Always enabled by default."
         , flagType = DynamicFlag
         , flagReverse = "-fno-vectorisation-avoidance"
         }
  , flag { flagName = "-fvectorise"
         , flagDescription = "Enable vectorisation of nested data parallelism"
         , flagType = DynamicFlag
         , flagReverse = "-fno-vectorise"
         }
  ]