-
Notifications
You must be signed in to change notification settings - Fork 833
[Parser] Parse call_ref #6103
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
[Parser] Parse call_ref #6103
Conversation
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
| ;; CHECK-NEXT: (local $0 (ref null $void)) | ||
| ;; CHECK-NEXT: (local $1 (ref null $ret2)) | ||
| ;; CHECK-NEXT: (local $2 (ref null $many)) | ||
| ;; CHECK-NEXT: (local $scratch (i32 i32)) |
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.
Why were these scratch values created?
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.
Because the call to many returns a tuple, which is then accessed by multiple different drop instructions. Since we have an expression tree, each value can only be consumed by one expression (its parent) normally. Since tuples need to be accessible by multiple expressions, they need to be stashed in locals first. The scratch locals are the locals IRBuilder introduces to hold these tuples.
| auto data = dataidx(ctx); | ||
| CHECK_ERR(data); | ||
| return ctx.makeArrayNewElem(pos, *type, *data); | ||
| return ctx.in.err("unimplemented instruction"); |
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.
Why is this now unimplemented?
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.
I noticed that it incorrectly used dataidx above, when it should have used elemidx, which doesn't exist yet. I removed the incorrect implementation with the standard "unimplemented" error.
80587bb to
c557024
Compare
0076179 to
50ffc2b
Compare
c557024 to
d8f004f
Compare
Also mark array.new_elem as unimplemented as a drive-by; it previously had an incorrect implementation.
50ffc2b to
08bc7a9
Compare
Also mark array.new_elem as unimplemented as a drive-by; it previously had an incorrect implementation.

Also mark array.new_elem as unimplemented as a drive-by; it previously had an
incorrect implementation.