-
Notifications
You must be signed in to change notification settings - Fork 3
register vmath desugar as post inference and remove pass #573
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
|
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.
Pull Request Overview
This PR refactors the vmath desugaring mechanism from an explicit pass-based approach to an automatic decorator-based approach using the @dialect.post_inference decorator. This simplifies the API by removing the need for manual invocation of the VMathDesugar pass in tests and user code.
Key Changes
- Removed manual
VMathDesugarpass instantiation from all test functions - Deleted the
VMathDesugarpass class andpasses.pyfile entirely - Added
@dialect.post_inferencedecorator toWalkDesugarBinopto automatically register the rewrite rule
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/dialects/vmath/test_desugar.py | Removed manual VMathDesugar pass calls from 6 test functions and removed the import, simplifying test code |
| src/kirin/dialects/vmath/rewrites/desugar.py | Added @dialect.post_inference decorator to WalkDesugarBinop class and imported the dialect object to enable automatic registration |
| src/kirin/dialects/vmath/passes.py | Deleted entire file containing the now-obsolete VMathDesugar pass class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This requires type inference to be run beforehand (and is run automatically for vmath after type inference). |
kaihsin
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.
LGTM
These changes are separate from (#568) since they are not compatible with kirin 0.17 (in case we want to backport).