-
Notifications
You must be signed in to change notification settings - Fork 792
Stack switching: fix some optimization passes #7271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c067464
to
19e57a7
Compare
Update the type of the blocks that are targets of the handlers of resume and resume_throw instructions.
We were incorrectly comparing a tag name with block types.
19e57a7
to
50d6418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience on this and sorry for the delay. Looks good, with just a couple minor comments.
@@ -503,6 +504,14 @@ class TypeMapper : public GlobalTypeRewriter { | |||
return getTempType(type); | |||
} | |||
|
|||
HeapType getNewHeapType(HeapType type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reimplement getNewType
using type.with(getNewHeapType(type.getHeapType())
.
src/wasm/wasm-ir-builder.cpp
Outdated
if (!params[nparams - 1].isContinuation()) { | ||
return Err{"the last argument of the continuation argument should be " | ||
"itself a continuation"}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave this to the validator? It doesn't look like ChildTyper::visitStackSwitch
depends on the last parameter correctly being a continuation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your time!
I have just removed this for now since validation is not implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Fuzzing on the main branch after this landed, I see
Hopefully that information (note the |
Hmm, |
Not just mine, but all of them 😉 #7430 |
This continues #7041 by adapting the optimizations passes to work with the stack switching instructions.