Skip to content
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

dialects: (math) Use SameOperandsAndResultType trait #3761

Merged

Conversation

compor
Copy link
Collaborator

@compor compor commented Jan 17, 2025

This PR:

  • Uses the SameOperandsAndResultType trait in the math dialect
  • Simplifies relevant test cases which were not using the return_type parameter

@compor compor added the dialects Changes on the dialects label Jan 17, 2025
@compor compor self-assigned this Jan 17, 2025

def __init__(
self, operand: Operation | SSAValue, fastmath: FastMathFlagsAttr | None = None
):
operand = SSAValue.get(operand)
return super().__init__(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Piggybacked this change as pylint was complaining.

@compor compor force-pushed the christos/dialects/math/use-same-operands-and-result-type-trait branch from b84370e to c97e740 Compare January 17, 2025 14:40
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.25%. Comparing base (7b2c906) to head (632563c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3761      +/-   ##
==========================================
- Coverage   91.26%   91.25%   -0.01%     
==========================================
  Files         461      461              
  Lines       57491    57479      -12     
  Branches     5543     5543              
==========================================
- Hits        52467    52455      -12     
  Misses       3602     3602              
  Partials     1422     1422              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@compor
Copy link
Collaborator Author

compor commented Jan 17, 2025

No sure I understand the CI lockfile fail, but I'll have a look later

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! What's blocking us from moving math out of experimental?

@compor
Copy link
Collaborator Author

compor commented Jan 17, 2025

Looks great! What's blocking us from moving math out of experimental?

I don't think anything, really, that was my goal with this.
I was just thinking a separate NFC PR for the move, but we can avoid the churn and do this here if you want.

from xdsl.utils.exceptions import VerifyException
from xdsl.utils.test_value import TestSSAValue

_BinOpArgT = TypeVar("_BinOpArgT", bound=Attribute)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused. Not sure what the initial outlook here was.

@superlopuh
Copy link
Member

Nice, I think separate PR is good.

Base automatically changed from christos/core/traits/same-operands-and-result-types to main January 20, 2025 10:38
@compor compor merged commit 9b81223 into main Jan 20, 2025
15 checks passed
@compor compor deleted the christos/dialects/math/use-same-operands-and-result-type-trait branch January 20, 2025 10:59
compor added a commit that referenced this pull request Jan 20, 2025
This PR:

- Move `math` dialect out of the experimental module (as a result of
#3761)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants