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

[BugFix][Arith] IterMapRewriter abort rewriting once failure #15677

Merged

Conversation

MasterJH5574
Copy link
Contributor

This PR fixes an issue of the IterMapRewriter. Prior to this PR, the mutation function of the rewriter class returns the mutation results even when an invalid PrimExpr pattern was detected.

Returning the mutation results when failure is not expected, and in such cases we should "abort" the mutation, and return the input PrimExpr which is not mutated, since insisting on returning the mutation results sometimes it incurs further error on other arith components like simplification.

One unit test is added to ensure the rewriter behaves as expectation.

This PR fixes an issue of the IterMapRewriter. Prior to this PR, the
mutation function of the rewriter class returns the mutation results
even when an invalid PrimExpr pattern was detected.

Returning the mutation results when failure is not expected, and in
such cases we should "abort" the mutation, and return the input
PrimExpr which is not mutated, since insisting on returning the
mutation results sometimes it incurs further error on other arith
components like simplification.

One unit test is added to ensure the rewriter behaves as expectation.
@tqchen tqchen merged commit 1e6e2b3 into apache:main Sep 6, 2023
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