-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
cf823e0
to
4798284
Compare
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more comment
Thanks @yzhliu @Hzfengsy @ZihengJiang |
* [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
* [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
* [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
* [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
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.