-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Unity] Implement R.macro for Relax macros #15455
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
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
3 similar comments
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
CC @slyubomirsky if you’d love to review |
|
I'll review, sorry I didn't see the pings. |
|
Can macros take in Relax vars as arguments and define new Relax vars? That would be an important test case for hygienic macros. Otherwise, everything in this PR looks good to me. edit: I think this case should simply work, but we should make sure of it. Relax var identity is determined by pointer, so creating new vars inside a macro should "just work." |
|
Any updates? |
|
Sorry, I was on vacation in the last two weeks. Relax macros are technically |
In the same way as T.macro, R.macro support hygiene (via "hygienic" keyword), but unlike TIR macros, Relax macros produce expressions, and have to return a value: the last statement in R.macro must be "return".
ccb67f4 to
c29f533
Compare
|
Rebased, and added a test for using (outside of a macro) a variable defined in a macro. |
junrushao
left a comment
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.
Looking good to me! @slyubomirsky would you like to take a second look?
In the same way as T.macro, R.macro support hygiene (via "hygienic" keyword), but unlike TIR macros, Relax macros produce expressions, and have to return a value: the last statement in R.macro must be "return".