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

[IR] Fix illegal intermediate IRs #806

Merged
merged 1 commit into from Apr 17, 2020
Merged

Conversation

xumingkuan
Copy link
Collaborator

Fix #739.

All hotfixes are removed.

[Click here for the format server]

Comment on lines -492 to +493
b->statements.insert(
b->statements.begin() + i + 1,
Stmt::make<OffloadedStmt>(OffloadedStmt::TaskType::gc, snode));
b->insert(Stmt::make<OffloadedStmt>(OffloadedStmt::TaskType::gc, snode),
i + 1);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Modifying Block::statements directly without setting parent was really bad...

If we set Block::statements to be private to prevent code fragments like this, we may need some functions like Block::get_statements() to keep code fragments like for (auto &stmt : b->statements) neat?

Copy link
Member

Choose a reason for hiding this comment

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

Right, probably something like Block::get_statements() const.

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

Comment on lines -492 to +493
b->statements.insert(
b->statements.begin() + i + 1,
Stmt::make<OffloadedStmt>(OffloadedStmt::TaskType::gc, snode));
b->insert(Stmt::make<OffloadedStmt>(OffloadedStmt::TaskType::gc, snode),
i + 1);
Copy link
Member

Choose a reason for hiding this comment

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

Right, probably something like Block::get_statements() const.

@yuanming-hu yuanming-hu merged commit 0cfffe3 into taichi-dev:master Apr 17, 2020
@xumingkuan xumingkuan deleted the fix-ir branch April 20, 2020 21:25
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.

[ir] Fix illegal intermediate IRs
2 participants