Fuse i64.{and,or,xor}
+ i64.eqz
+ i32.eqz
+ br_if
#803
Labels
good first issue
Good for newcomers
optimization
An performance optimization issue.
register-machine
A work item for the register-machine engine.
The instruction sequence
Is very common. The
i64.eqz, i32.eqz
sequence acts as a double negative, thus nullifying itself. It exists for the purpose of casting thei64
into ai32
which the Wasm validation expects byif
andbr_if
to form something likeif and(a, b)
wherea
andb
are bothi64
typed values.This requires addition of the following
wasmi
IR instructions:New compute instructions for the intermediate fuse steps:
i64.and_eqz
i64.and_eqz_imm16
i64.or_eqz
i64.or_eqz_imm16
i64.xor_eqz
i64.xor_eqz_imm16
New branch instructions:
i64.branch_and_eqz
i64.branch_and_eqz_imm16
i64.branch_or_eqz
i64.branch_or_eqz_imm16
i64.branch_xor_eqz
i64.branch_xor_eqz_imm16
This should be benchmarks thoroughly since it might well be that the addition of this optimization might degrade
wasmi
performance instead of acting as an optimization.The text was updated successfully, but these errors were encountered: