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

[Flow] Raise special linalg.generic ops to linalg.fill ops #14773

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

Max191
Copy link
Contributor

@Max191 Max191 commented Aug 22, 2023

No description provided.

Copy link
Contributor

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

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

Nice! Just one minor comment.

Value yieldOperand;
for (Operation &bodyOp : linalgOp.getBlock()->getOperations()) {
if (isa<linalg::YieldOp>(bodyOp))
yieldOperand = bodyOp.getOperand(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to check that the yield operand is not the basic block argument of the linalg operation itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be good now. Lmk what you think.

@Max191 Max191 force-pushed the raise_generics_to_fills branch 2 times, most recently from a02ba09 to 2281e94 Compare August 22, 2023 17:21
Copy link
Contributor

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

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

Sorry, forgot to push my comments from yesterday. I think this works. Left a few comments. There could be a cleanup of the logic that could be done after the fact to simplify the code. Happy to chat more.

// Check that the op body is only a linalg.yield op.
Value yieldOperand;
for (Operation &bodyOp : linalgOp.getBlock()->getOperations()) {
if (isa<linalg::YieldOp>(bodyOp))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: please add { around all statements (this is divergence in IREE style w.r.t LLVM style)

// Check that the operand of the linalg.yield op is not an argument of the
// linalg.generic basic block
for (Value blockArg : linalgOp.getBlock()->getArguments())
if (yieldOperand == blockArg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same nit here. Please add braces always in IREE.

@Max191 Max191 force-pushed the raise_generics_to_fills branch 2 times, most recently from c720f45 to a488f29 Compare August 25, 2023 00:09
@Max191
Copy link
Contributor Author

Max191 commented Aug 25, 2023

rebased on top of main

@qedawkins qedawkins merged commit b24a6e2 into iree-org:main Aug 25, 2023
50 checks passed
@Max191 Max191 deleted the raise_generics_to_fills branch October 25, 2024 14:04
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