Skip to content

Conversation

@martin-luecke
Copy link
Contributor

@martin-luecke martin-luecke commented Nov 4, 2025

This introduces a generic unary op lowering pattern for Wave ops operating on a float-like operand and wires it into the lowering pass.

  • Lowers wave.exp2 to math.exp2, supporting scalar, vector, and tensor float-like types.
  • Adds a test to verify the wave.exp2 lowering.

- exp2 as an initial example

Signed-off-by: Martin Lücke <martin.luecke@amd.com>
Copilot AI review requested due to automatic review settings November 4, 2025 08:14
Copy link
Contributor

Copilot AI left a 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 UnaryOpLoweringPattern template for lowering Wave unary operations
  • Implements lowering of wave.exp2 to math.exp2 for float-like types
  • Adds test coverage for the exp2 lowering

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>
Copilot AI review requested due to automatic review settings November 5, 2025 11:11
Copy link
Contributor

Copilot AI left a 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.

@martin-luecke martin-luecke merged commit 9243913 into main Nov 5, 2025
25 checks passed
@martin-luecke martin-luecke deleted the exp2lowering branch November 5, 2025 13:55
Megan0704-1 pushed a commit to Megan0704-1/wave that referenced this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants