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

[Substrait] Add pattern removing duplicate yields in project. #846

Conversation

ingomueller-net
Copy link
Collaborator

@ingomueller-net ingomueller-net commented May 31, 2024

This PR depends on and, therefor, includes #836 and its dependencies.

This PR adds a pattern to the emit deduplication pass that removes
duplicates introduced by the project op by yielding values more than
once.

MLIRContext *context = op.getContext();
Operation *terminator = op.getExpressions().front().getTerminator();
int64_t numOriginalYields = terminator->getNumOperands();
auto inputTupleType = cast<TupleType>(op.getInput().getType());
Copy link
Member

Choose a reason for hiding this comment

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

And this is verified for ProjectOp that it has only TupleType inputs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. (input is of type Substrait_Relation, which is a placeholder for a to-be-implemented relation type that is currently a (nested) tuple.

In these cases, I do not need to do anything else that I do here, right?

@ingomueller-net ingomueller-net force-pushed the substrait-emit-deduplication-project-yield branch from ccddb3c to 8d61245 Compare July 23, 2024 13:00
This PR adds a pattern to the emit deduplication pass that removes
duplicates introduced by the `project` op by yielding values more than
once.

Signed-off-by: Ingo Müller <[email protected]>
@ingomueller-net ingomueller-net force-pushed the substrait-emit-deduplication-project-yield branch from 8d61245 to 7b3ca6d Compare July 23, 2024 13:08
@ingomueller-net ingomueller-net merged commit fd68aa1 into iree-org:main Jul 23, 2024
3 checks passed
@ingomueller-net ingomueller-net deleted the substrait-emit-deduplication-project-yield branch July 23, 2024 13:18
ingomueller-net added a commit to ingomueller-net/substrait-mlir-contrib that referenced this pull request Oct 15, 2024
…-org/iree-llvm-sandbox#846)

This PR adds a pattern to the emit deduplication pass that removes
duplicates introduced by the `project` op by yielding values more than
once.

Signed-off-by: Ingo Müller <[email protected]>
ingomueller-net added a commit to ingomueller-net/substrait-mlir-contrib that referenced this pull request Oct 15, 2024
…-org/iree-llvm-sandbox#846)

This PR adds a pattern to the emit deduplication pass that removes
duplicates introduced by the `project` op by yielding values more than
once.

Signed-off-by: Ingo Müller <[email protected]>
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.

2 participants