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

core: Add attributes to func outputs #3661

Merged
merged 9 commits into from
Dec 21, 2024

Conversation

mamanain
Copy link
Collaborator

Mlir supports attributes for output types. We need for cross compatibility with other mlir projects.

@mamanain mamanain self-assigned this Dec 20, 2024
@mamanain mamanain added the core xDSL core (ir, textual format, ...) label Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.29%. Comparing base (b394263) to head (5c401b0).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3661      +/-   ##
==========================================
+ Coverage   90.73%   91.29%   +0.56%     
==========================================
  Files         467      466       -1     
  Lines       58965    58327     -638     
  Branches     5640     5638       -2     
==========================================
- Hits        53500    53248     -252     
+ Misses       4020     3629     -391     
- Partials     1445     1450       +5     

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

// CHECK: func.func @output_attributes() -> (f32 {"a" = 0 : i32}, f32 {"b" = 0 : i32, "c" = 1 : i64}) {
// CHECK-NEXT: %r1, %r2 = "test.op"() : () -> (f32, f32)
// CHECK-NEXT: func.return %r1, %r2 : f32, f32
// CHECK-NEXT: }
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have a generic format filecheck and an mlir integration filecheck for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. Done.

Comment on lines 177 to 181
(name, input_types, return_types, region, extra_attrs, arg_attrs, _) = (
parse_func_op_like(
parser,
reserved_attr_names=("sym_name", "function_type", "sym_visibility"),
)
Copy link
Member

Choose a reason for hiding this comment

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

can you please raise NotImplementedError if there are any res_attrs here and in other places?

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.

nice

@mamanain mamanain merged commit 955600d into xdslproject:main Dec 21, 2024
15 checks passed
@mamanain mamanain deleted the manainen/output-attributes branch December 21, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants