diff options
author | Heejin Ahn <aheejin@gmail.com> | 2024-02-06 12:22:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 12:22:56 -0800 |
commit | 3db60dfeb4cb07b239e7f3210b20af547a6554fc (patch) | |
tree | d86755829e8c35c591f9772843dda08363c7f4ca /src/binaryen-c.cpp | |
parent | d490318d64a0de809c19333c4b1c5ddfdfa65d18 (diff) | |
download | binaryen-3db60dfeb4cb07b239e7f3210b20af547a6554fc.tar.gz binaryen-3db60dfeb4cb07b239e7f3210b20af547a6554fc.tar.bz2 binaryen-3db60dfeb4cb07b239e7f3210b20af547a6554fc.zip |
[EH] Add --experimental-new-eh option to wasm-opt (#6270)
This adds `--experimental-new-eh` option to `wasm-opt`. The difference
between this and `--translate-to-new-eh` is, `--translate-to-new-eh`
just runs `TranslateToNewEH` pass, while `--experimental-new-eh`
attaches `TranslateToNewEH` pass at the end of the whole optimization
pipeline. So if no other passes or optimization options (`-On`) are
specified, it is equivalent to `--translate-to-new-eh`. If other
optimization passes are specified, it runs them and at the end run the
translator to ensure the new EH instructions are emitted. The reason we
are doing this this way is that the optimization pipeline as a whole
does not support the new EH instruction yet, but we would like to
provide an option to emit a reasonably OK code with the new EH
instructions.
This also means when the optimization level > 3, it will also run
the StackIR + local2stack optimization after the translation.
Not sure how to test the output of this option, given that there is not
much point in testing the default optimization passes, and it is also
not clear how to print the stack IR if the stack ir generation and
optimization runs as a part of the pipeline and not the explicit command
line options.
This is created in favor of #6267, which added the option to
`optimization-options.h`. It had a problem of running the translator
multiple times when `-On` was given multiple times in the command line,
which I learned was rather a common usage. This adds the option directly
to `wasm-opt.cpp`, which avoids the problem. With this, it is still
possible to create and optimize Stack IR unnecessarily, but that feels a
better alternative.
Diffstat (limited to 'src/binaryen-c.cpp')
0 files changed, 0 insertions, 0 deletions