tqchen commented on a change in pull request #5368: [TIR] Fix lower_warp_memory
when there are >1 warp buffers
URL: https://github.com/apache/incubator-tvm/pull/5368#discussion_r410718199
##########
File path: src/tir/transforms/lower_warp_memory.cc
##########
@@ -379,7 +379,7 @@ class WarpMemoryRewriter : private StmtMutator {
Stmt VisitStmt_(const AllocateNode* op) {
if (warp_buffer_.count(op->buffer_var.get())) {
WarpAccessRewriter rewriter(warp_size_, &analyzer_);
- return rewriter.Rewrite(op);
+ return StmtMutator::VisitStmt_(rewriter.Rewrite(op).as<AllocateNode>());
Review comment:
Let us consider Post order rewriting pattern instead
```c++
auto ret = StmtMutator::VisitStmt_(op);
op = ret.as<AllocateNode>();
if (warp_buffer_.count(op->buffer_var.get())) {
// rewrite transformations
}
return ret;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services