-
Notifications
You must be signed in to change notification settings - Fork 25
Add lowering for unary wave ops #424
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
- exp2 as an initial example Signed-off-by: Martin Lücke <martin.luecke@amd.com>
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 adds support for lowering the Wave dialect's exp2 operation to MLIR's math.exp2 operation. The implementation follows the existing pattern established for binary operations, introducing a generic unary operation lowering pattern.
Key changes:
- Adds a generic
UnaryOpLoweringPatterntemplate for lowering Wave unary operations - Implements lowering of
wave.exp2tomath.exp2for float-like types - Adds test coverage for the
exp2lowering
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| water/lib/Dialect/Wave/Transforms/LoweringPatterns.cpp | Implements UnaryOpLoweringPattern template and populateWaveUnaryOpLoweringPatterns function |
| water/lib/Dialect/Wave/Transforms/LowerWaveToMLIR.cpp | Registers Math dialect, marks wave::Exp2Op as illegal, and calls unary op lowering patterns |
| water/include/water/Dialect/Wave/Transforms/LoweringPatterns.h | Declares populateWaveUnaryOpLoweringPatterns function |
| water/include/water/Dialect/Wave/Transforms/Passes.td | Adds Math dialect as a dependent dialect |
| water/lib/Dialect/Wave/Transforms/CMakeLists.txt | Adds MLIRMathDialect to the link dependencies |
| water/test/Dialect/Wave/lower-wave-to-mlir.mlir | Adds test case for exp2 lowering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Martin Lücke <martin.luecke@amd.com>
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This introduces a generic unary op lowering pattern for Wave ops operating on a float-like operand and wires it into the lowering pass.