RemoveUnusedBrs: Make branches to traps just trap themselves#8398
RemoveUnusedBrs: Make branches to traps just trap themselves#8398kripken merged 7 commits intoWebAssembly:mainfrom
Conversation
| if (child->name.is() && child->name != curr->name && | ||
| child->type == curr->type) { |
There was a problem hiding this comment.
Possible drive-by or follow-on improvement. The outer block cannot be unreachable unless its single child is also unreachable, so no need to check the outer type. The outer block may have a strict supertype of the inner block, but that would be ok.
| if (child->name.is() && child->name != curr->name && | |
| child->type.isConcrete()) { |
There was a problem hiding this comment.
sg, I can look into that later.
src/passes/RemoveUnusedBrs.cpp
Outdated
| // Anything branching to the child will end up in that second | ||
| // instruction |after|. |
There was a problem hiding this comment.
Please add a mention of the cases of |after| we will optimize.
| (call $import) | ||
| (call $import) |
There was a problem hiding this comment.
What's the purpose of having two calls here?
There was a problem hiding this comment.
It's nice to help differentiate the if arms. could also have been a call param.
There was a problem hiding this comment.
It would be nice to port this to lit! Then I would be able to see what test input corresponds to the changed output.
There was a problem hiding this comment.
I can port this test after, or do you want it first?
We already did jump threading, folding a br->br to a single br. This
does br->trap into a trap.