diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-05-10 14:38:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 14:38:20 -0700 |
commit | 6efa4a97b2c643bf35756bb6e989b90d6b3e44bc (patch) | |
tree | 64593c763ca43a2c641c652f5e39ac13db0618ef /check.py | |
parent | dbe3384034e12909694c554149a1fb536fbece21 (diff) | |
download | binaryen-6efa4a97b2c643bf35756bb6e989b90d6b3e44bc.tar.gz binaryen-6efa4a97b2c643bf35756bb6e989b90d6b3e44bc.tar.bz2 binaryen-6efa4a97b2c643bf35756bb6e989b90d6b3e44bc.zip |
Flatten control flow pass (#999)
This pass flattens out control flow in order to achieve 2 properties:
* Control flow structures (block, loop, if) and control flow operations (br, br_if, br_table, return, unreachable) may only be block children, a loop body, or an if-true or if-false. (I.e., they cannot be nested inside an i32.add, a drop, a call, an if-condition, etc.)
* Disallow block, loop, and if return values, i.e., do not use control flow to pass around values.
As a result, expressions cannot contain control flow, and overall control flow is simpler, more structured, and more "flat".
This should make things like re-relooping wasm code much easier, as they can run after the cfg is flattened
Diffstat (limited to 'check.py')
0 files changed, 0 insertions, 0 deletions