[EH] Test StackIR's local2stack on translator output #6264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds
STACKIR-OPTfilecheck lines totranslate-to-new-eh.wastto see if StackIR'slocal2stackoptimization successfully removes some of unnecessarylocal.set/local.gets.While supporting the whole Binayren optimization pipeline for the new EH instructions is not the goal for the very near-term future, StackIR's
local2stackoptimization can help with a very common pattern generated by this translator, which is:is translated to
Here we don't really need
local.set $exnandlocal.get $exn, and these can be optimized away using StackIR's local2stack. After optimizing them away in Stack IR, the code can be likeThis optimization alone reduces the code size increased caused by translating significantly. For Adobe Photoshop, the code size increase goes down from 4.2% to 2.8%, and for Binaryen, it goes down from 3.8% to 2.0%.