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

[Unity] Avoid trivial var2 = var1 bindings in pattern matcher #15578

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, pattern matches that returned a variable (e.g. rewriting R.add(x, R.const(0.0)) into x) would result in rewriting y = R.add(x, R.const(0.0)) to the trivial binding y = x. This commit updates the pattern matcher to instead remove the y variable entirely in this case.

Prior to this commit, pattern matches that returned a
variable (e.g. rewriting `R.add(x, R.const(0.0))` into `x`) would
result in rewriting `y = R.add(x, R.const(0.0))` to the trivial
binding `y = x`.  This commit updates the pattern matcher to instead
remove the `y` variable entirely in this case.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Aug 16, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Hzfengsy Hzfengsy merged commit 567848e into apache:unity Aug 20, 2023
@Lunderberg Lunderberg deleted the unity_avoid_trivial_bindings_when_pattern_matching branch August 20, 2023 13:51
masahi added a commit to masahi/tvm that referenced this pull request Aug 31, 2023
masahi added a commit to masahi/tvm that referenced this pull request Sep 26, 2023
masahi added a commit to masahi/tvm that referenced this pull request Sep 27, 2023
masahi added a commit to masahi/tvm that referenced this pull request Sep 27, 2023
commit 99c2a59
Author: Masahiro Masuda <[email protected]>
Date:   Wed Sep 27 09:57:21 2023 +0900

    Revert "Revert "[Unity] Avoid trivial `var2 = var1` bindings in pattern matcher (apache#15578)""

    This reverts commit 0a6a617.

commit 9a3ca64
Author: Masahiro Masuda <[email protected]>
Date:   Wed Sep 27 09:55:02 2023 +0900

    wip

commit be01900
Author: Masahiro Masuda <[email protected]>
Date:   Tue Sep 26 19:55:29 2023 +0900

    fix test

commit a026b65
Author: Masahiro Masuda <[email protected]>
Date:   Thu Aug 31 22:24:38 2023 +0000

    wip

commit 233d2d0
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:42:11 2023 +0000

    wip

commit 0a6a617
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:28:25 2023 +0000

    Revert "[Unity] Avoid trivial `var2 = var1` bindings in pattern matcher (apache#15578)"

    This reverts commit 567848e.

commit 6c5a435
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:28:16 2023 +0000

    wip

commit 7926cbc
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 06:17:01 2023 +0000

    wip

commit 9828698
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 15:11:47 2023 +0900

    wip

commit 5d01fd1
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 06:05:56 2023 +0000

    wip

commit ae657b7
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 14:49:21 2023 +0900

    wip

commit ddcab38
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 05:42:41 2023 +0000

    wip

commit ab3572d
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 10:40:34 2023 +0900

    wip

commit 690b88e
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 10:25:33 2023 +0900

    update rev
vinx13 pushed a commit that referenced this pull request Sep 27, 2023
…tion (#15831)

* Squashed commit of the following:

commit 99c2a59
Author: Masahiro Masuda <[email protected]>
Date:   Wed Sep 27 09:57:21 2023 +0900

    Revert "Revert "[Unity] Avoid trivial `var2 = var1` bindings in pattern matcher (#15578)""

    This reverts commit 0a6a617.

commit 9a3ca64
Author: Masahiro Masuda <[email protected]>
Date:   Wed Sep 27 09:55:02 2023 +0900

    wip

commit be01900
Author: Masahiro Masuda <[email protected]>
Date:   Tue Sep 26 19:55:29 2023 +0900

    fix test

commit a026b65
Author: Masahiro Masuda <[email protected]>
Date:   Thu Aug 31 22:24:38 2023 +0000

    wip

commit 233d2d0
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:42:11 2023 +0000

    wip

commit 0a6a617
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:28:25 2023 +0000

    Revert "[Unity] Avoid trivial `var2 = var1` bindings in pattern matcher (#15578)"

    This reverts commit 567848e.

commit 6c5a435
Author: Masahiro Masuda <[email protected]>
Date:   Tue Aug 29 17:28:16 2023 +0000

    wip

commit 7926cbc
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 06:17:01 2023 +0000

    wip

commit 9828698
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 15:11:47 2023 +0900

    wip

commit 5d01fd1
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 06:05:56 2023 +0000

    wip

commit ae657b7
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 14:49:21 2023 +0900

    wip

commit ddcab38
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 05:42:41 2023 +0000

    wip

commit ab3572d
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 10:40:34 2023 +0900

    wip

commit 690b88e
Author: Masahiro Masuda <[email protected]>
Date:   Mon Aug 28 10:25:33 2023 +0900

    update rev

* black

* clean

* add doc

* update rev

* update test

* fix

---------

Co-authored-by: Masahiro Masuda <[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.

4 participants