diff options
author | Alon Zakai <azakai@google.com> | 2021-10-04 15:45:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 15:45:43 -0700 |
commit | 8895a2417d37e3444c98f0023e98ab9151d04290 (patch) | |
tree | 4b233b178e80f39a1177c26e093613fa932fbc25 /src/compiler-support.h | |
parent | 972062c373e599a5f75d70fa0569e9d0b57854bf (diff) | |
download | binaryen-8895a2417d37e3444c98f0023e98ab9151d04290.tar.gz binaryen-8895a2417d37e3444c98f0023e98ab9151d04290.tar.bz2 binaryen-8895a2417d37e3444c98f0023e98ab9151d04290.zip |
Optimize call_indirect of a select of two constants (#4208)
(call_indirect
..args..
(select
(i32.const x)
(i32.const y)
(condition)
)
)
=>
(if
(condition)
(call $func-for-x
..args..
)
(call $func-for-y
..args..
)
)
To do this we must reorder the condition with the args, and also use
the args more than once, so place them all in locals.
This works towards the goal of polymorphic devirtualization, that is,
turning an indirect call of more than one possible target into more
than one direct call.
Diffstat (limited to 'src/compiler-support.h')
0 files changed, 0 insertions, 0 deletions