You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,14 @@ There are a few differences between Binaryen IR and the WebAssembly language:
46
46
* Blocks without names may not be branch targets.
47
47
* Names are required to be unique. (Reading wast files with duplicate names is supported; the names are modified when the IR is constructed).
48
48
* As an optimization, a block that is the child of a loop (or if arm, or function toplevel) and which has no branches targeting it will not be emitted when generating wasm. Instead its list of operands will be directly used in the containing node. Such a block is sometimes called an "implicit block".
49
-
50
-
51
-
52
49
53
50
As a result, you might notice that round-trip conversions (wasm => Binaryen IR => wasm) change code a little in some corner cases.
54
51
52
+
Notes when working with Binaryen IR:
53
+
54
+
* As mentioned above, Binaryen IR has a tree structure. As a result, each expression should have exactly one parent - you should not "reuse" a node by having it appear more than once in the tree. The motivation for this limitation is that when we optimize we modify nodes, so if they appear more than once in the tree, a change in one place can appear in another incorrectly.
55
+
* For similar reasons, nodes should not appear in more than one functions.
56
+
55
57
## Tools
56
58
57
59
This repository contains code that builds the following tools in `bin/`:
0 commit comments