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] Fix a wrong use of std::move() in cross-thread reduction lowering #9728

Conversation

MasterJH5574
Copy link
Contributor

Find a wrong use of std::move(). Please see the changes for detail. The wrong use leads to undefined Var of a buffer's data field.

Given C++ evaluates parameter expressions from the end to the beginning, we should use std::move at the first occurrence, instead of the last.

cc @junrushao1994 @Hzfengsy

@junrushao
Copy link
Member

Looks like I triggered an undefined behavior of C++ 🥺

@MasterJH5574
Copy link
Contributor Author

😂

Given the undefined behavior of evaluation order, we decided to remove the std::move() here. Code was updated in the last commit.

@junrushao junrushao merged commit 4e70931 into apache:main Dec 14, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
…owering (apache#9728)

* [BugFix] Fix a wrong use of `std::move()` in cross-thread reduction lowering

* Remove
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
…owering (apache#9728)

* [BugFix] Fix a wrong use of `std::move()` in cross-thread reduction lowering

* Remove
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
…owering (apache#9728)

* [BugFix] Fix a wrong use of `std::move()` in cross-thread reduction lowering

* Remove
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
…owering (apache#9728)

* [BugFix] Fix a wrong use of `std::move()` in cross-thread reduction lowering

* Remove
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
…owering (apache#9728)

* [BugFix] Fix a wrong use of `std::move()` in cross-thread reduction lowering

* Remove
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