@grain/binaryen.ml 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binaryen-archive/CHANGELOG.md +26 -0
- binaryen-archive/README.md +16 -0
- binaryen-archive/binaryen.opam +2 -4
- binaryen-archive/dune +1 -1
- binaryen-archive/esy.lock/index.json +6 -94
- binaryen-archive/package.json +3 -5
- binaryen-archive/src/binaryen_stubs_exports.js +110 -0
- binaryen-archive/src/binaryen_stubs_expressions.js +1613 -0
- binaryen-archive/src/binaryen_stubs_features.js +105 -0
- binaryen-archive/src/binaryen_stubs_functions.js +92 -0
- binaryen-archive/src/binaryen_stubs_globals.js +62 -0
- binaryen-archive/src/binaryen_stubs_imports.js +86 -0
- binaryen-archive/src/binaryen_stubs_literals.js +29 -0
- binaryen-archive/src/binaryen_stubs_memory.js +25 -0
- binaryen-archive/src/binaryen_stubs_modules.js +121 -0
- binaryen-archive/src/binaryen_stubs_ops.js +1895 -0
- binaryen-archive/src/binaryen_stubs_settings.js +120 -0
- binaryen-archive/src/binaryen_stubs_tables.c +2 -0
- binaryen-archive/src/binaryen_stubs_tables.js +84 -0
- binaryen-archive/src/binaryen_stubs_types.js +73 -0
- binaryen-archive/src/dune +11 -4
- binaryen-archive/{virtual → src}/element_segment.mli +0 -0
- binaryen-archive/{virtual → src}/export.mli +0 -0
- binaryen-archive/{virtual → src}/expression.mli +0 -0
- binaryen-archive/{virtual → src}/function.mli +0 -0
- binaryen-archive/{virtual → src}/global.mli +0 -0
- binaryen-archive/{virtual → src}/import.mli +0 -0
- binaryen-archive/src/literal.ml +0 -13
- binaryen-archive/src/literal.mli +8 -0
- binaryen-archive/src/memory.ml +6 -6
- binaryen-archive/{virtual → src}/memory.mli +1 -1
- binaryen-archive/src/module.ml +1 -1
- binaryen-archive/{virtual → src}/module.mli +1 -1
- binaryen-archive/{virtual → src}/op.mli +0 -0
- binaryen-archive/src/passes.ml +345 -0
- binaryen-archive/src/passes.mli +343 -0
- binaryen-archive/{virtual → src}/settings.mli +0 -0
- binaryen-archive/{virtual → src}/table.mli +0 -0
- binaryen-archive/{virtual → src}/type.mli +0 -0
- binaryen-archive/test/dune +2 -22
- binaryen-archive/test/test.expected +8 -4
- binaryen-archive/test/test.ml +33 -10
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +0 -44
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +0 -45
- binaryen-archive/esy.lock/opam/uchar.0.0.2/opam +0 -36
- binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch +0 -11
- binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json +0 -11
- binaryen-archive/js/binaryen.es5.js +0 -363
- binaryen-archive/js/dune +0 -13
- binaryen-archive/js/element_segment.ml +0 -33
- binaryen-archive/js/export.ml +0 -57
- binaryen-archive/js/expression.ml +0 -1105
- binaryen-archive/js/function.ml +0 -60
- binaryen-archive/js/global.ml +0 -48
- binaryen-archive/js/import.ml +0 -69
- binaryen-archive/js/literal.ml +0 -28
- binaryen-archive/js/memory.ml +0 -39
- binaryen-archive/js/module.ml +0 -116
- binaryen-archive/js/op.ml +0 -482
- binaryen-archive/js/prelude.js +0 -2
- binaryen-archive/js/settings.ml +0 -60
- binaryen-archive/js/stubs.c +0 -15
- binaryen-archive/js/table.ml +0 -29
- binaryen-archive/js/type.ml +0 -21
- binaryen-archive/virtual/dune +0 -6
- binaryen-archive/virtual/literal.mli +0 -19
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
type t = string
|
|
2
|
+
|
|
3
|
+
(** lower unaligned loads and stores to smaller aligned ones *)
|
|
4
|
+
let alignment_lowering = "alignment-lowering"
|
|
5
|
+
|
|
6
|
+
(** async/await style transform, allowing pausing and resuming *)
|
|
7
|
+
let asyncify = "asyncify"
|
|
8
|
+
|
|
9
|
+
(** Tries to avoid reinterpret operations via more loads *)
|
|
10
|
+
let avoid_reinterprets = "avoid-reinterprets"
|
|
11
|
+
|
|
12
|
+
(** removes arguments to calls in an lto-like manner *)
|
|
13
|
+
let dae = "dae"
|
|
14
|
+
|
|
15
|
+
(** removes arguments to calls in an lto-like manner, and optimizes where we removed *)
|
|
16
|
+
let dae_optimizing = "dae-optimizing"
|
|
17
|
+
|
|
18
|
+
(** reduce # of locals by coalescing *)
|
|
19
|
+
let coalesce_locals = "coalesce-locals"
|
|
20
|
+
|
|
21
|
+
(** reduce # of locals by coalescing and learning *)
|
|
22
|
+
let coalesce_locals_learning = "coalesce-locals-learning"
|
|
23
|
+
|
|
24
|
+
(** push code forward, potentially making it not always execute *)
|
|
25
|
+
let code_pushing = "code-pushing"
|
|
26
|
+
|
|
27
|
+
(** fold code, merging duplicates *)
|
|
28
|
+
let code_folding = "code-folding"
|
|
29
|
+
|
|
30
|
+
(** hoist repeated constants to a local *)
|
|
31
|
+
let const_hoisting = "const-hoisting"
|
|
32
|
+
|
|
33
|
+
(** propagate constant struct field values *)
|
|
34
|
+
let cfp = "cfp"
|
|
35
|
+
|
|
36
|
+
(** removes unreachable code *)
|
|
37
|
+
let dce = "dce"
|
|
38
|
+
|
|
39
|
+
(** forces all loads and stores to have alignment 1 *)
|
|
40
|
+
let dealign = "dealign"
|
|
41
|
+
|
|
42
|
+
(** instrument the wasm to convert NaNs into 0 at runtime *)
|
|
43
|
+
let denan = "denan"
|
|
44
|
+
|
|
45
|
+
(** turns indirect calls into direct ones *)
|
|
46
|
+
let directize = "directize"
|
|
47
|
+
|
|
48
|
+
(** optimizes using the DataFlow SSA IR *)
|
|
49
|
+
let dfo = "dfo"
|
|
50
|
+
|
|
51
|
+
(** dump DWARF debug info sections from the read binary *)
|
|
52
|
+
let dwarfdump = "dwarfdump"
|
|
53
|
+
|
|
54
|
+
(** removes duplicate imports *)
|
|
55
|
+
let duplicate_import_elimination = "duplicate-import-elimination"
|
|
56
|
+
|
|
57
|
+
(** removes duplicate functions *)
|
|
58
|
+
let duplicate_function_elimination = "duplicate-function-elimination"
|
|
59
|
+
|
|
60
|
+
(** emit the target features section in the output *)
|
|
61
|
+
let emit_target_features = "emit-target-features"
|
|
62
|
+
|
|
63
|
+
(** leaves just one function (useful for debugging) *)
|
|
64
|
+
let extract_function = "extract-function"
|
|
65
|
+
|
|
66
|
+
(** leaves just one function selected by index *)
|
|
67
|
+
let extract_function_index = "extract-function-index"
|
|
68
|
+
|
|
69
|
+
(** flattens out code, removing nesting *)
|
|
70
|
+
let flatten = "flatten"
|
|
71
|
+
|
|
72
|
+
(** emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work *)
|
|
73
|
+
let fpcast_emu = "fpcast-emu"
|
|
74
|
+
|
|
75
|
+
(** reports function metrics *)
|
|
76
|
+
let func_metrics = "func-metrics"
|
|
77
|
+
|
|
78
|
+
(** generate dynCall fuctions used by emscripten ABI *)
|
|
79
|
+
let generate_dyncalls = "generate-dyncalls"
|
|
80
|
+
|
|
81
|
+
(** generate dynCall functions used by emscripten ABI, but only for functions with i64 in their signature (which cannot be invoked via the wasm table without JavaScript BigInt support). *)
|
|
82
|
+
let generate_i64_dyncalls = "generate-i64-dyncalls"
|
|
83
|
+
|
|
84
|
+
(** generate Stack IR *)
|
|
85
|
+
let generate_stack_ir = "generate-stack-ir"
|
|
86
|
+
|
|
87
|
+
(** refine the types of globals *)
|
|
88
|
+
let global_refining = "global-refining"
|
|
89
|
+
|
|
90
|
+
(** globally optimize GC types *)
|
|
91
|
+
let gto = "gto"
|
|
92
|
+
|
|
93
|
+
(** apply more specific subtypes to type fields where possible *)
|
|
94
|
+
let type_refining = "type-refining"
|
|
95
|
+
|
|
96
|
+
(** replace GC allocations with locals *)
|
|
97
|
+
let heap2local = "heap2local"
|
|
98
|
+
|
|
99
|
+
(** inline __original_main into main *)
|
|
100
|
+
let inline_main = "inline-main"
|
|
101
|
+
|
|
102
|
+
(** inline functions (you probably want inlining-optimizing) *)
|
|
103
|
+
let inlining = "inlining"
|
|
104
|
+
|
|
105
|
+
(** inline functions and optimizes where we inlined *)
|
|
106
|
+
let inlining_optimizing = "inlining-optimizing"
|
|
107
|
+
|
|
108
|
+
(** lower away binaryen intrinsics *)
|
|
109
|
+
let intrinsic_lowering = "intrinsic-lowering"
|
|
110
|
+
|
|
111
|
+
(** legalizes i64 types on the import/export boundary *)
|
|
112
|
+
let legalize_js_interface = "legalize-js-interface"
|
|
113
|
+
|
|
114
|
+
(** legalizes i64 types on the import/export boundary in a minimal manner, only on things only JS will call *)
|
|
115
|
+
let legalize_js_interface_minimally = "legalize-js-interface-minimally"
|
|
116
|
+
|
|
117
|
+
(** common subexpression elimination inside basic blocks *)
|
|
118
|
+
let local_cse = "local-cse"
|
|
119
|
+
|
|
120
|
+
(** apply more specific subtypes to locals where possible *)
|
|
121
|
+
let local_subtyping = "local-subtyping"
|
|
122
|
+
|
|
123
|
+
(** instrument the build with logging of where execution goes *)
|
|
124
|
+
let log_execution = "log-execution"
|
|
125
|
+
|
|
126
|
+
(** lower all uses of i64s to use i32s instead *)
|
|
127
|
+
let i64_to_i32_lowering = "i64-to-i32-lowering"
|
|
128
|
+
|
|
129
|
+
(** instrument the build with code to intercept all loads and stores *)
|
|
130
|
+
let instrument_locals = "instrument-locals"
|
|
131
|
+
|
|
132
|
+
(** instrument the build with code to intercept all loads and stores *)
|
|
133
|
+
let instrument_memory = "instrument-memory"
|
|
134
|
+
|
|
135
|
+
(** loop invariant code motion *)
|
|
136
|
+
let licm = "licm"
|
|
137
|
+
|
|
138
|
+
(** attempt to merge segments to fit within web limits *)
|
|
139
|
+
let limit_segments = "limit-segments"
|
|
140
|
+
|
|
141
|
+
(** lower loads and stores to a 64-bit memory to instead use a 32-bit one *)
|
|
142
|
+
let memory64_lowering = "memory64-lowering"
|
|
143
|
+
|
|
144
|
+
(** packs memory into separate segments, skipping zeros *)
|
|
145
|
+
let memory_packing = "memory-packing"
|
|
146
|
+
|
|
147
|
+
(** merges blocks to their parents *)
|
|
148
|
+
let merge_blocks = "merge-blocks"
|
|
149
|
+
|
|
150
|
+
(** merges locals when beneficial *)
|
|
151
|
+
let merge_locals = "merge-locals"
|
|
152
|
+
|
|
153
|
+
(** reports metrics *)
|
|
154
|
+
let metrics = "metrics"
|
|
155
|
+
|
|
156
|
+
(** minifies import names (only those, and not export names), and emits a mapping to the minified ones *)
|
|
157
|
+
let minify_imports = "minify-imports"
|
|
158
|
+
|
|
159
|
+
(** minifies both import and export names, and emits a mapping to the minified ones *)
|
|
160
|
+
let minify_imports_and_exports = "minify-imports-and-exports"
|
|
161
|
+
|
|
162
|
+
(** minifies both import and export names, and emits a mapping to the minified ones, and minifies the modules as well *)
|
|
163
|
+
let minify_imports_and_exports_and_modules =
|
|
164
|
+
"minify-imports-and-exports-and-modules"
|
|
165
|
+
|
|
166
|
+
(** apply the assumption that asyncify imports always unwind, and we never rewind *)
|
|
167
|
+
let mod_asyncify_always_and_only_unwind = "mod-asyncify-always-and-only-unwind"
|
|
168
|
+
|
|
169
|
+
(** apply the assumption that asyncify never unwinds *)
|
|
170
|
+
let mod_asyncify_never_unwind = "mod-asyncify-never-unwind"
|
|
171
|
+
|
|
172
|
+
(** name list *)
|
|
173
|
+
let nm = "nm"
|
|
174
|
+
|
|
175
|
+
(** (re)name all heap types *)
|
|
176
|
+
let name_types = "name-types"
|
|
177
|
+
|
|
178
|
+
(** reduces calls to code that only runs once *)
|
|
179
|
+
let once_reduction = "once-reduction"
|
|
180
|
+
|
|
181
|
+
(** optimizes added constants into load/store offsets *)
|
|
182
|
+
let optimize_added_constants = "optimize-added-constants"
|
|
183
|
+
|
|
184
|
+
(** optimizes added constants into load/store offsets, propagating them across locals too *)
|
|
185
|
+
let optimize_added_constants_propagate = "optimize-added-constants-propagate"
|
|
186
|
+
|
|
187
|
+
(** optimizes instruction combinations *)
|
|
188
|
+
let optimize_instructions = "optimize-instructions"
|
|
189
|
+
|
|
190
|
+
(** optimize Stack IR *)
|
|
191
|
+
let optimize_stack_ir = "optimize-stack-ir"
|
|
192
|
+
|
|
193
|
+
(** pick load signs based on their uses *)
|
|
194
|
+
let pick_load_signs = "pick-load-signs"
|
|
195
|
+
|
|
196
|
+
(** Tranform Binaryen IR into Poppy IR *)
|
|
197
|
+
let poppify = "poppify"
|
|
198
|
+
|
|
199
|
+
(** miscellaneous optimizations for Emscripten-generated code *)
|
|
200
|
+
let post_emscripten = "post-emscripten"
|
|
201
|
+
|
|
202
|
+
(** early optimize of the instruction combinations for js *)
|
|
203
|
+
let optimize_for_js = "optimize-for-js"
|
|
204
|
+
|
|
205
|
+
(** computes compile-time evaluatable expressions *)
|
|
206
|
+
let precompute = "precompute"
|
|
207
|
+
|
|
208
|
+
(** computes compile-time evaluatable expressions and propagates them through locals *)
|
|
209
|
+
let precompute_propagate = "precompute-propagate"
|
|
210
|
+
|
|
211
|
+
(** print in s-expression format *)
|
|
212
|
+
let print = "print"
|
|
213
|
+
|
|
214
|
+
(** print in minified s-expression format *)
|
|
215
|
+
let print_minified = "print-minified"
|
|
216
|
+
|
|
217
|
+
(** print options for enabled features *)
|
|
218
|
+
let print_features = "print-features"
|
|
219
|
+
|
|
220
|
+
(** print in full s-expression format *)
|
|
221
|
+
let print_full = "print-full"
|
|
222
|
+
|
|
223
|
+
(** print call graph *)
|
|
224
|
+
let print_call_graph = "print-call-graph"
|
|
225
|
+
|
|
226
|
+
(** print a map of function indexes to names *)
|
|
227
|
+
let print_function_map = "print-function-map"
|
|
228
|
+
|
|
229
|
+
(** alias for print_function_map *)
|
|
230
|
+
let symbolmap = "symbolmap"
|
|
231
|
+
|
|
232
|
+
(** print out Stack IR (useful for internal debugging) *)
|
|
233
|
+
let print_stack_ir = "print-stack-ir"
|
|
234
|
+
|
|
235
|
+
(** removes operations incompatible with js *)
|
|
236
|
+
let remove_non_js_ops = "remove-non-js-ops"
|
|
237
|
+
|
|
238
|
+
(** removes imports and replaces them with nops *)
|
|
239
|
+
let remove_imports = "remove-imports"
|
|
240
|
+
|
|
241
|
+
(** removes memory segments *)
|
|
242
|
+
let remove_memory = "remove-memory"
|
|
243
|
+
|
|
244
|
+
(** removes breaks from locations that are not needed *)
|
|
245
|
+
let remove_unused_brs = "remove-unused-brs"
|
|
246
|
+
|
|
247
|
+
(** removes unused module elements *)
|
|
248
|
+
let remove_unused_module_elements = "remove-unused-module-elements"
|
|
249
|
+
|
|
250
|
+
(** removes unused module elements that are not functions *)
|
|
251
|
+
let remove_unused_nonfunction_module_elements =
|
|
252
|
+
"remove-unused-nonfunction-module-elements"
|
|
253
|
+
|
|
254
|
+
(** removes names from locations that are never branched to *)
|
|
255
|
+
let remove_unused_names = "remove-unused-names"
|
|
256
|
+
|
|
257
|
+
(** sorts functions by access frequency *)
|
|
258
|
+
let reorder_functions = "reorder-functions"
|
|
259
|
+
|
|
260
|
+
(** sorts locals by access frequency *)
|
|
261
|
+
let reorder_locals = "reorder-locals"
|
|
262
|
+
|
|
263
|
+
(** re-optimize control flow using the relooper algorithm *)
|
|
264
|
+
let rereloop = "rereloop"
|
|
265
|
+
|
|
266
|
+
(** remove redundant local.sets *)
|
|
267
|
+
let rse = "rse"
|
|
268
|
+
|
|
269
|
+
(** write the module to binary, then read it *)
|
|
270
|
+
let roundtrip = "roundtrip"
|
|
271
|
+
|
|
272
|
+
(** instrument loads and stores to check for invalid behavior *)
|
|
273
|
+
let safe_heap = "safe-heap"
|
|
274
|
+
|
|
275
|
+
(** sets specified globals to specified values *)
|
|
276
|
+
let set_globals = "set-globals"
|
|
277
|
+
|
|
278
|
+
(** apply more specific subtypes to signature types where possible *)
|
|
279
|
+
let signature_refining = "signature-refining"
|
|
280
|
+
|
|
281
|
+
(** miscellaneous globals-related optimizations *)
|
|
282
|
+
let simplify_globals = "simplify-globals"
|
|
283
|
+
|
|
284
|
+
(** miscellaneous globals-related optimizations, and optimizes where we replaced global.gets with constants *)
|
|
285
|
+
let simplify_globals_optimizing = "simplify-globals-optimizing"
|
|
286
|
+
|
|
287
|
+
(** miscellaneous locals-related optimizations *)
|
|
288
|
+
let simplify_locals = "simplify-locals"
|
|
289
|
+
|
|
290
|
+
(** miscellaneous locals-related optimizations (no nesting at all; preserves flatness) *)
|
|
291
|
+
let simplify_locals_nonesting = "simplify-locals-nonesting"
|
|
292
|
+
|
|
293
|
+
(** miscellaneous locals-related optimizations (no tees) *)
|
|
294
|
+
let simplify_locals_notee = "simplify-locals-notee"
|
|
295
|
+
|
|
296
|
+
(** miscellaneous locals-related optimizations (no structure) *)
|
|
297
|
+
let simplify_locals_nostructure = "simplify-locals-nostructure"
|
|
298
|
+
|
|
299
|
+
(** miscellaneous locals-related optimizations (no tees or structure) *)
|
|
300
|
+
let simplify_locals_notee_nostructure = "simplify-locals-notee-nostructure"
|
|
301
|
+
|
|
302
|
+
(** emit Souper IR in text form *)
|
|
303
|
+
let souperify = "souperify"
|
|
304
|
+
|
|
305
|
+
(** emit Souper IR in text form (single-use nodes only) *)
|
|
306
|
+
let souperify_single_use = "souperify-single-use"
|
|
307
|
+
|
|
308
|
+
(** stub out unsupported JS operations *)
|
|
309
|
+
let stub_unsupported_js = "stub-unsupported-js"
|
|
310
|
+
|
|
311
|
+
(** ssa-ify variables so that they have a single assignment *)
|
|
312
|
+
let ssa = "ssa"
|
|
313
|
+
|
|
314
|
+
(** ssa-ify variables so that they have a single assignment, ignoring merges *)
|
|
315
|
+
let ssa_nomerge = "ssa-nomerge"
|
|
316
|
+
|
|
317
|
+
(** deprecated; same as strip-debug *)
|
|
318
|
+
let strip = "strip"
|
|
319
|
+
|
|
320
|
+
(** enforce limits on llvm's __stack_pointer global *)
|
|
321
|
+
let stack_check = "stack-check"
|
|
322
|
+
|
|
323
|
+
(** strip debug info (including the names section) *)
|
|
324
|
+
let strip_debug = "strip-debug"
|
|
325
|
+
|
|
326
|
+
(** strip dwarf debug info *)
|
|
327
|
+
let strip_dwarf = "strip-dwarf"
|
|
328
|
+
|
|
329
|
+
(** strip the wasm producers section *)
|
|
330
|
+
let strip_producers = "strip-producers"
|
|
331
|
+
|
|
332
|
+
(** strip the wasm target features section *)
|
|
333
|
+
let strip_target_features = "strip-target-features"
|
|
334
|
+
|
|
335
|
+
(** replace trapping operations with clamping semantics *)
|
|
336
|
+
let trap_mode_clamp = "trap-mode-clamp"
|
|
337
|
+
|
|
338
|
+
(** replace trapping operations with js semantics *)
|
|
339
|
+
let trap_mode_js = "trap-mode-js"
|
|
340
|
+
|
|
341
|
+
(** removes local.tees, replacing them with sets and gets *)
|
|
342
|
+
let untee = "untee"
|
|
343
|
+
|
|
344
|
+
(** removes obviously unneeded code *)
|
|
345
|
+
let vacuum = "vacuum"
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
type t
|
|
2
|
+
|
|
3
|
+
val alignment_lowering : t
|
|
4
|
+
(** lower unaligned loads and stores to smaller aligned ones *)
|
|
5
|
+
|
|
6
|
+
val asyncify : t
|
|
7
|
+
(** async/await style transform, allowing pausing and resuming *)
|
|
8
|
+
|
|
9
|
+
val avoid_reinterprets : t
|
|
10
|
+
(** Tries to avoid reinterpret operations via more loads *)
|
|
11
|
+
|
|
12
|
+
val dae : t
|
|
13
|
+
(** removes arguments to calls in an lto-like manner *)
|
|
14
|
+
|
|
15
|
+
val dae_optimizing : t
|
|
16
|
+
(** removes arguments to calls in an lto-like manner, and optimizes where we removed *)
|
|
17
|
+
|
|
18
|
+
val coalesce_locals : t
|
|
19
|
+
(** reduce # of locals by coalescing *)
|
|
20
|
+
|
|
21
|
+
val coalesce_locals_learning : t
|
|
22
|
+
(** reduce # of locals by coalescing and learning *)
|
|
23
|
+
|
|
24
|
+
val code_pushing : t
|
|
25
|
+
(** push code forward, potentially making it not always execute *)
|
|
26
|
+
|
|
27
|
+
val code_folding : t
|
|
28
|
+
(** fold code, merging duplicates *)
|
|
29
|
+
|
|
30
|
+
val const_hoisting : t
|
|
31
|
+
(** hoist repeated constants to a local *)
|
|
32
|
+
|
|
33
|
+
val cfp : t
|
|
34
|
+
(** propagate constant struct field values *)
|
|
35
|
+
|
|
36
|
+
val dce : t
|
|
37
|
+
(** removes unreachable code *)
|
|
38
|
+
|
|
39
|
+
val dealign : t
|
|
40
|
+
(** forces all loads and stores to have alignment 1 *)
|
|
41
|
+
|
|
42
|
+
val denan : t
|
|
43
|
+
(** instrument the wasm to convert NaNs into 0 at runtime *)
|
|
44
|
+
|
|
45
|
+
val directize : t
|
|
46
|
+
(** turns indirect calls into direct ones *)
|
|
47
|
+
|
|
48
|
+
val dfo : t
|
|
49
|
+
(** optimizes using the DataFlow SSA IR *)
|
|
50
|
+
|
|
51
|
+
val dwarfdump : t
|
|
52
|
+
(** dump DWARF debug info sections from the read binary *)
|
|
53
|
+
|
|
54
|
+
val duplicate_import_elimination : t
|
|
55
|
+
(** removes duplicate imports *)
|
|
56
|
+
|
|
57
|
+
val duplicate_function_elimination : t
|
|
58
|
+
(** removes duplicate functions *)
|
|
59
|
+
|
|
60
|
+
val emit_target_features : t
|
|
61
|
+
(** emit the target features section in the output *)
|
|
62
|
+
|
|
63
|
+
val extract_function : t
|
|
64
|
+
(** leaves just one function (useful for debugging) *)
|
|
65
|
+
|
|
66
|
+
val extract_function_index : t
|
|
67
|
+
(** leaves just one function selected by index *)
|
|
68
|
+
|
|
69
|
+
val flatten : t
|
|
70
|
+
(** flattens out code, removing nesting *)
|
|
71
|
+
|
|
72
|
+
val fpcast_emu : t
|
|
73
|
+
(** emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work *)
|
|
74
|
+
|
|
75
|
+
val func_metrics : t
|
|
76
|
+
(** reports function metrics *)
|
|
77
|
+
|
|
78
|
+
val generate_dyncalls : t
|
|
79
|
+
(** generate dynCall fuctions used by emscripten ABI *)
|
|
80
|
+
|
|
81
|
+
val generate_i64_dyncalls : t
|
|
82
|
+
(** generate dynCall functions used by emscripten ABI, but only for functions with i64 in their signature (which cannot be invoked via the wasm table without JavaScript BigInt support). *)
|
|
83
|
+
|
|
84
|
+
val generate_stack_ir : t
|
|
85
|
+
(** generate Stack IR *)
|
|
86
|
+
|
|
87
|
+
val global_refining : t
|
|
88
|
+
(** refine the types of globals *)
|
|
89
|
+
|
|
90
|
+
val gto : t
|
|
91
|
+
(** globally optimize GC types *)
|
|
92
|
+
|
|
93
|
+
val type_refining : t
|
|
94
|
+
(** apply more specific subtypes to type fields where possible *)
|
|
95
|
+
|
|
96
|
+
val heap2local : t
|
|
97
|
+
(** replace GC allocations with locals *)
|
|
98
|
+
|
|
99
|
+
val inline_main : t
|
|
100
|
+
(** inline __original_main into main *)
|
|
101
|
+
|
|
102
|
+
val inlining : t
|
|
103
|
+
(** inline functions (you probably want inlining-optimizing) *)
|
|
104
|
+
|
|
105
|
+
val inlining_optimizing : t
|
|
106
|
+
(** inline functions and optimizes where we inlined *)
|
|
107
|
+
|
|
108
|
+
val intrinsic_lowering : t
|
|
109
|
+
(** lower away binaryen intrinsics *)
|
|
110
|
+
|
|
111
|
+
val legalize_js_interface : t
|
|
112
|
+
(** legalizes i64 types on the import/export boundary *)
|
|
113
|
+
|
|
114
|
+
val legalize_js_interface_minimally : t
|
|
115
|
+
(** legalizes i64 types on the import/export boundary in a minimal manner, only on things only JS will call *)
|
|
116
|
+
|
|
117
|
+
val local_cse : t
|
|
118
|
+
(** common subexpression elimination inside basic blocks *)
|
|
119
|
+
|
|
120
|
+
val local_subtyping : t
|
|
121
|
+
(** apply more specific subtypes to locals where possible *)
|
|
122
|
+
|
|
123
|
+
val log_execution : t
|
|
124
|
+
(** instrument the build with logging of where execution goes *)
|
|
125
|
+
|
|
126
|
+
val i64_to_i32_lowering : t
|
|
127
|
+
(** lower all uses of i64s to use i32s instead *)
|
|
128
|
+
|
|
129
|
+
val instrument_locals : t
|
|
130
|
+
(** instrument the build with code to intercept all loads and stores *)
|
|
131
|
+
|
|
132
|
+
val instrument_memory : t
|
|
133
|
+
(** instrument the build with code to intercept all loads and stores *)
|
|
134
|
+
|
|
135
|
+
val licm : t
|
|
136
|
+
(** loop invariant code motion *)
|
|
137
|
+
|
|
138
|
+
val limit_segments : t
|
|
139
|
+
(** attempt to merge segments to fit within web limits *)
|
|
140
|
+
|
|
141
|
+
val memory64_lowering : t
|
|
142
|
+
(** lower loads and stores to a 64-bit memory to instead use a 32-bit one *)
|
|
143
|
+
|
|
144
|
+
val memory_packing : t
|
|
145
|
+
(** packs memory into separate segments, skipping zeros *)
|
|
146
|
+
|
|
147
|
+
val merge_blocks : t
|
|
148
|
+
(** merges blocks to their parents *)
|
|
149
|
+
|
|
150
|
+
val merge_locals : t
|
|
151
|
+
(** merges locals when beneficial *)
|
|
152
|
+
|
|
153
|
+
val metrics : t
|
|
154
|
+
(** reports metrics *)
|
|
155
|
+
|
|
156
|
+
val minify_imports : t
|
|
157
|
+
(** minifies import names (only those, and not export names), and emits a mapping to the minified ones *)
|
|
158
|
+
|
|
159
|
+
val minify_imports_and_exports : t
|
|
160
|
+
(** minifies both import and export names, and emits a mapping to the minified ones *)
|
|
161
|
+
|
|
162
|
+
val minify_imports_and_exports_and_modules : t
|
|
163
|
+
(** minifies both import and export names, and emits a mapping to the minified ones, and minifies the modules as well *)
|
|
164
|
+
|
|
165
|
+
val mod_asyncify_always_and_only_unwind : t
|
|
166
|
+
(** apply the assumption that asyncify imports always unwind, and we never rewind *)
|
|
167
|
+
|
|
168
|
+
val mod_asyncify_never_unwind : t
|
|
169
|
+
(** apply the assumption that asyncify never unwinds *)
|
|
170
|
+
|
|
171
|
+
val nm : t
|
|
172
|
+
(** name list *)
|
|
173
|
+
|
|
174
|
+
val name_types : t
|
|
175
|
+
(** (re)name all heap types *)
|
|
176
|
+
|
|
177
|
+
val once_reduction : t
|
|
178
|
+
(** reduces calls to code that only runs once *)
|
|
179
|
+
|
|
180
|
+
val optimize_added_constants : t
|
|
181
|
+
(** optimizes added constants into load/store offsets *)
|
|
182
|
+
|
|
183
|
+
val optimize_added_constants_propagate : t
|
|
184
|
+
(** optimizes added constants into load/store offsets, propagating them across locals too *)
|
|
185
|
+
|
|
186
|
+
val optimize_instructions : t
|
|
187
|
+
(** optimizes instruction combinations *)
|
|
188
|
+
|
|
189
|
+
val optimize_stack_ir : t
|
|
190
|
+
(** optimize Stack IR *)
|
|
191
|
+
|
|
192
|
+
val pick_load_signs : t
|
|
193
|
+
(** pick load signs based on their uses *)
|
|
194
|
+
|
|
195
|
+
val poppify : t
|
|
196
|
+
(** Tranform Binaryen IR into Poppy IR *)
|
|
197
|
+
|
|
198
|
+
val post_emscripten : t
|
|
199
|
+
(** miscellaneous optimizations for Emscripten-generated code *)
|
|
200
|
+
|
|
201
|
+
val optimize_for_js : t
|
|
202
|
+
(** early optimize of the instruction combinations for js *)
|
|
203
|
+
|
|
204
|
+
val precompute : t
|
|
205
|
+
(** computes compile-time evaluatable expressions *)
|
|
206
|
+
|
|
207
|
+
val precompute_propagate : t
|
|
208
|
+
(** computes compile-time evaluatable expressions and propagates them through locals *)
|
|
209
|
+
|
|
210
|
+
val print : t
|
|
211
|
+
(** print in s-expression format *)
|
|
212
|
+
|
|
213
|
+
val print_minified : t
|
|
214
|
+
(** print in minified s-expression format *)
|
|
215
|
+
|
|
216
|
+
val print_features : t
|
|
217
|
+
(** print options for enabled features *)
|
|
218
|
+
|
|
219
|
+
val print_full : t
|
|
220
|
+
(** print in full s-expression format *)
|
|
221
|
+
|
|
222
|
+
val print_call_graph : t
|
|
223
|
+
(** print call graph *)
|
|
224
|
+
|
|
225
|
+
val print_function_map : t
|
|
226
|
+
(** print a map of function indexes to names *)
|
|
227
|
+
|
|
228
|
+
val symbolmap : t
|
|
229
|
+
(** alias for print_function_map *)
|
|
230
|
+
|
|
231
|
+
val print_stack_ir : t
|
|
232
|
+
(** print out Stack IR (useful for internal debugging) *)
|
|
233
|
+
|
|
234
|
+
val remove_non_js_ops : t
|
|
235
|
+
(** removes operations incompatible with js *)
|
|
236
|
+
|
|
237
|
+
val remove_imports : t
|
|
238
|
+
(** removes imports and replaces them with nops *)
|
|
239
|
+
|
|
240
|
+
val remove_memory : t
|
|
241
|
+
(** removes memory segments *)
|
|
242
|
+
|
|
243
|
+
val remove_unused_brs : t
|
|
244
|
+
(** removes breaks from locations that are not needed *)
|
|
245
|
+
|
|
246
|
+
val remove_unused_module_elements : t
|
|
247
|
+
(** removes unused module elements *)
|
|
248
|
+
|
|
249
|
+
val remove_unused_nonfunction_module_elements : t
|
|
250
|
+
(** removes unused module elements that are not functions *)
|
|
251
|
+
|
|
252
|
+
val remove_unused_names : t
|
|
253
|
+
(** removes names from locations that are never branched to *)
|
|
254
|
+
|
|
255
|
+
val reorder_functions : t
|
|
256
|
+
(** sorts functions by access frequency *)
|
|
257
|
+
|
|
258
|
+
val reorder_locals : t
|
|
259
|
+
(** sorts locals by access frequency *)
|
|
260
|
+
|
|
261
|
+
val rereloop : t
|
|
262
|
+
(** re-optimize control flow using the relooper algorithm *)
|
|
263
|
+
|
|
264
|
+
val rse : t
|
|
265
|
+
(** remove redundant local.sets *)
|
|
266
|
+
|
|
267
|
+
val roundtrip : t
|
|
268
|
+
(** write the module to binary, then read it *)
|
|
269
|
+
|
|
270
|
+
val safe_heap : t
|
|
271
|
+
(** instrument loads and stores to check for invalid behavior *)
|
|
272
|
+
|
|
273
|
+
val set_globals : t
|
|
274
|
+
(** sets specified globals to specified values *)
|
|
275
|
+
|
|
276
|
+
val signature_refining : t
|
|
277
|
+
(** apply more specific subtypes to signature types where possible *)
|
|
278
|
+
|
|
279
|
+
val simplify_globals : t
|
|
280
|
+
(** miscellaneous globals-related optimizations *)
|
|
281
|
+
|
|
282
|
+
val simplify_globals_optimizing : t
|
|
283
|
+
(** miscellaneous globals-related optimizations, and optimizes where we replaced global.gets with constants *)
|
|
284
|
+
|
|
285
|
+
val simplify_locals : t
|
|
286
|
+
(** miscellaneous locals-related optimizations *)
|
|
287
|
+
|
|
288
|
+
val simplify_locals_nonesting : t
|
|
289
|
+
(** miscellaneous locals-related optimizations (no nesting at all; preserves flatness) *)
|
|
290
|
+
|
|
291
|
+
val simplify_locals_notee : t
|
|
292
|
+
(** miscellaneous locals-related optimizations (no tees) *)
|
|
293
|
+
|
|
294
|
+
val simplify_locals_nostructure : t
|
|
295
|
+
(** miscellaneous locals-related optimizations (no structure) *)
|
|
296
|
+
|
|
297
|
+
val simplify_locals_notee_nostructure : t
|
|
298
|
+
(** miscellaneous locals-related optimizations (no tees or structure) *)
|
|
299
|
+
|
|
300
|
+
val souperify : t
|
|
301
|
+
(** emit Souper IR in text form *)
|
|
302
|
+
|
|
303
|
+
val souperify_single_use : t
|
|
304
|
+
(** emit Souper IR in text form (single-use nodes only) *)
|
|
305
|
+
|
|
306
|
+
val stub_unsupported_js : t
|
|
307
|
+
(** stub out unsupported JS operations *)
|
|
308
|
+
|
|
309
|
+
val ssa : t
|
|
310
|
+
(** ssa-ify variables so that they have a single assignment *)
|
|
311
|
+
|
|
312
|
+
val ssa_nomerge : t
|
|
313
|
+
(** ssa-ify variables so that they have a single assignment, ignoring merges *)
|
|
314
|
+
|
|
315
|
+
val strip : t
|
|
316
|
+
(** deprecated; same as strip-debug *)
|
|
317
|
+
|
|
318
|
+
val stack_check : t
|
|
319
|
+
(** enforce limits on llvm's __stack_pointer global *)
|
|
320
|
+
|
|
321
|
+
val strip_debug : t
|
|
322
|
+
(** strip debug info (including the names section) *)
|
|
323
|
+
|
|
324
|
+
val strip_dwarf : t
|
|
325
|
+
(** strip dwarf debug info *)
|
|
326
|
+
|
|
327
|
+
val strip_producers : t
|
|
328
|
+
(** strip the wasm producers section *)
|
|
329
|
+
|
|
330
|
+
val strip_target_features : t
|
|
331
|
+
(** strip the wasm target features section *)
|
|
332
|
+
|
|
333
|
+
val trap_mode_clamp : t
|
|
334
|
+
(** replace trapping operations with clamping semantics *)
|
|
335
|
+
|
|
336
|
+
val trap_mode_js : t
|
|
337
|
+
(** replace trapping operations with js semantics *)
|
|
338
|
+
|
|
339
|
+
val untee : t
|
|
340
|
+
(** removes local.tees, replacing them with sets and gets *)
|
|
341
|
+
|
|
342
|
+
val vacuum : t
|
|
343
|
+
(** removes obviously unneeded code *)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|