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

[REFACTOR][IR] Introduce SeqStmt to replace ir::Block #4627

Merged
merged 4 commits into from
Jan 6, 2020

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Jan 6, 2020

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

@tqchen
Copy link
Member Author

tqchen commented Jan 6, 2020

cc @icemelon9 @yzhliu @Hzfengsy

@tqchen tqchen force-pushed the seq branch 2 times, most recently from cf823e0 to 4798284 Compare January 6, 2020 01:38
tqchen added 3 commits January 5, 2020 18:58
ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.
include/tvm/ir.h Outdated
return (*(operator->()))[index];
}
/*!
* \brief Construct a flattened sequence statement.
Copy link
Member

Choose a reason for hiding this comment

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

more specifically, it is to flatten a consumer? can we elaborate a bit in the comment why this is useful?

Copy link
Member Author

Choose a reason for hiding this comment

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

The consumer tag was not as useful as producers and can in general be dropped. This was the original behavior that we used to had in Flattening sequences. Once we uprgade to the versions the Producer consumer markup may cease to be useful, so we can safely remove that part

Copy link
Member Author

Choose a reason for hiding this comment

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

I added more comment

@tqchen tqchen merged commit 3595cbe into apache:master Jan 6, 2020
@tqchen
Copy link
Member Author

tqchen commented Jan 6, 2020

Thanks @yzhliu @Hzfengsy @ZihengJiang

@tqchen tqchen deleted the seq branch January 6, 2020 19:19
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
* [REFACTOR][IR] Introduce SeqStmt to replace Block

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

* [REFACTOR] Migrate use of Block to SeqStmt.

* [REFACTOR] Remove Block

* Add more comments per yizhi's comment
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
* [REFACTOR][IR] Introduce SeqStmt to replace Block

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

* [REFACTOR] Migrate use of Block to SeqStmt.

* [REFACTOR] Remove Block

* Add more comments per yizhi's comment
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
* [REFACTOR][IR] Introduce SeqStmt to replace Block

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

* [REFACTOR] Migrate use of Block to SeqStmt.

* [REFACTOR] Remove Block

* Add more comments per yizhi's comment
tqchen added a commit to tqchen/tvm that referenced this pull request Mar 29, 2020
* [REFACTOR][IR] Introduce SeqStmt to replace Block

ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.

This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.

* [REFACTOR] Migrate use of Block to SeqStmt.

* [REFACTOR] Remove Block

* Add more comments per yizhi's comment
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