Skip to content

Optimize if of br_if#2216

Merged
kripken merged 11 commits intomasterfrom
ifbrif
Jul 11, 2019
Merged

Optimize if of br_if#2216
kripken merged 11 commits intomasterfrom
ifbrif

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Jul 11, 2019

An if whose body is a br_if can be turned into a br_if of a combined condition (if side effects allow it).

The naive size in bytes is identical between the patterns, but the select may avoid a hardware branch, and also the select may be further optimized. On the benchmark suite this helps every single benchmark, but by quite small amounts (e.g. 100 bytes on sqlite, which is 1MB).

This was noticed in emscripten-core/emscripten#8941

@kripken kripken merged commit 03f3528 into master Jul 11, 2019
@kripken kripken deleted the ifbrif branch July 11, 2019 15:55
kripken added a commit that referenced this pull request Jul 11, 2019
This became noticeable after #2216 which led to some eqz eqz pairs in the test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant