diff options
author | Alon Zakai <azakai@google.com> | 2021-05-12 16:32:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 16:32:28 -0700 |
commit | 665718a208786238633192d706c5cd61d4f5ad05 (patch) | |
tree | 5ec197754c6dc98d9698d7d2bfe532aeae025927 /src/passes/PrintFunctionMap.cpp | |
parent | bfd01369a6dbb4629e88d227f085f959549e3dd5 (diff) | |
download | binaryen-665718a208786238633192d706c5cd61d4f5ad05.tar.gz binaryen-665718a208786238633192d706c5cd61d4f5ad05.tar.bz2 binaryen-665718a208786238633192d706c5cd61d4f5ad05.zip |
[Wasm GC] Heap2Local: Handle branches (#3881)
If we branch to a block, and there are no other branches or a final
value on the block either, then there is no mixing, and we may be able
to optimize the allocation. Before this PR, all branches stopped us.
To do this, add some helpers in BranchUtils.
The main flow logic in Heap2Local used to stop when we reached a
child for the second time. With branches, however, a child can flow both to
its immediate parent, and to branch targets, and so the proper thing to look
at is when we reach a parent for the second time (which would definitely
indicate mixing).
Tests are added for the new functionality. Note that some existing tests
already covered some things we should not optimize, and so no tests
were needed for them. The existing ones are: $get-through-block,
$branch-to-block.
Diffstat (limited to 'src/passes/PrintFunctionMap.cpp')
0 files changed, 0 insertions, 0 deletions