The simplify-locals and coalesce-locals passes work best when in SSA form, i.e., each variable is assigned once (except for phis, which have multiple assigns on branches going to the same place). It would be useful to be able to go back to SSA form, so that we can better optimize wasms not generated by us.
Some initial exploration code is in the ssa branch, but I'm not sure how useful it is. Anyhow, this should be fairly simple to do.
The simplify-locals and coalesce-locals passes work best when in SSA form, i.e., each variable is assigned once (except for phis, which have multiple assigns on branches going to the same place). It would be useful to be able to go back to SSA form, so that we can better optimize wasms not generated by us.
Some initial exploration code is in the
ssabranch, but I'm not sure how useful it is. Anyhow, this should be fairly simple to do.