summaryrefslogtreecommitdiff
path: root/test/lit/help/wasm-metadce.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/help/wasm-metadce.test')
-rw-r--r--test/lit/help/wasm-metadce.test73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/lit/help/wasm-metadce.test b/test/lit/help/wasm-metadce.test
new file mode 100644
index 000000000..1a8255346
--- /dev/null
+++ b/test/lit/help/wasm-metadce.test
@@ -0,0 +1,73 @@
+;; RUN: wasm-metadce --help | filecheck %s
+
+;; CHECK: wasm-metadce INFILE
+;; CHECK-NEXT:
+;; CHECK-NEXT: This tool performs dead code elimination (DCE) on a larger space that the wasm
+;; CHECK-NEXT: module is just a part of. For example, if you have JS and wasm that are
+;; CHECK-NEXT: connected, this can DCE the combined graph. By doing so, it is able to eliminate
+;; CHECK-NEXT: wasm module exports, which otherwise regular optimizations cannot.
+;; CHECK-NEXT:
+;; CHECK-NEXT: This tool receives a representation of the reachability graph that the wasm
+;; CHECK-NEXT: module resides in, which contains abstract nodes and connections showing what
+;; CHECK-NEXT: they reach. Some of those nodes can represent the wasm module's imports and
+;; CHECK-NEXT: exports. The tool then completes the graph by adding the internal parts of the
+;; CHECK-NEXT: module, and does DCE on the entire thing.
+;; CHECK-NEXT:
+;; CHECK-NEXT: This tool will output a wasm module with dead code eliminated, and metadata
+;; CHECK-NEXT: describing the things in the rest of the graph that can be eliminated as well.
+;; CHECK-NEXT:
+;; CHECK-NEXT: The graph description file should represent the graph in the following JSON-like
+;; CHECK-NEXT: notation (note, this is not true JSON, things like comments, escaping,
+;; CHECK-NEXT: single-quotes, etc. are not supported):
+;; CHECK-NEXT:
+;; CHECK-NEXT: [
+;; CHECK-NEXT: {
+;; CHECK-NEXT: "name": "entity1",
+;; CHECK-NEXT: "reaches": ["entity2, "entity3"],
+;; CHECK-NEXT: "root": true
+;; CHECK-NEXT: },
+;; CHECK-NEXT: {
+;; CHECK-NEXT: "name": "entity2",
+;; CHECK-NEXT: "reaches": ["entity1, "entity4"]
+;; CHECK-NEXT: },
+;; CHECK-NEXT: {
+;; CHECK-NEXT: "name": "entity3",
+;; CHECK-NEXT: "reaches": ["entity1"],
+;; CHECK-NEXT: "export": "export1"
+;; CHECK-NEXT: },
+;; CHECK-NEXT: {
+;; CHECK-NEXT: "name": "entity4",
+;; CHECK-NEXT: "import": ["module", "import1"]
+;; CHECK-NEXT: },
+;; CHECK-NEXT: ]
+;; CHECK-NEXT:
+;; CHECK-NEXT: Each entity has a name and an optional list of the other entities it reaches. It
+;; CHECK-NEXT: can also be marked as a root, export (with the export string), or import (with
+;; CHECK-NEXT: the module and import strings). DCE then computes what is reachable from the
+;; CHECK-NEXT: roots.
+;; CHECK-NEXT:
+
+;; Skip standard tool options
+
+;; CHECK: --no-validation,-n Disables validation, assumes inputs are
+;; CHECK-NEXT: correct
+;; CHECK-NEXT:
+;; CHECK-NEXT: --pass-arg,-pa An argument passed along to optimization
+;; CHECK-NEXT: passes being run. Must be in the form
+;; CHECK-NEXT: KEY@VALUE
+;; CHECK-NEXT:
+;; CHECK-NEXT: --nominal Use the prototype nominal type system
+;; CHECK-NEXT: instead of the normal equirecursive type
+;; CHECK-NEXT: system.
+;; CHECK-NEXT:
+;; CHECK-NEXT: --output,-o Output file (stdout if not specified)
+;; CHECK-NEXT:
+;; CHECK-NEXT: --emit-text,-S Emit text instead of binary for the
+;; CHECK-NEXT: output file
+;; CHECK-NEXT:
+;; CHECK-NEXT: --debuginfo,-g Emit names section and debug info
+;; CHECK-NEXT:
+;; CHECK-NEXT: --graph-file,-f Filename of the graph description file
+;; CHECK-NEXT:
+;; CHECK-NEXT: --dump,-d Dump the combined graph file (useful for
+;; CHECK-NEXT: debugging)