Skip to content

Commit 4d7e93c

Browse files
authored
[TIR] Output DeclBuffer in LowerThreadAllreduce (#15646)
For any local buffers allocated as part of `LowerThreadAllreduce`, generate a `DeclBuffer`. This is a subset of the changes made in #14778, broken out for ease of testing and review.
1 parent 25b8a07 commit 4d7e93c

File tree

2 files changed

+201
-231
lines changed

2 files changed

+201
-231
lines changed

src/tir/transforms/lower_thread_allreduce.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ class ThreadAllreduceBuilder final : public StmtExprMutator {
429429
// Fix all local allocations as all statements are built.
430430
Stmt body = SeqStmt::Flatten(seq);
431431
for (Buffer buf : new_alloc_bufs) {
432+
body = DeclBuffer(buf, body);
432433
body = Allocate(buf->data, buf->dtype, buf->shape, const_true(buf->dtype.lanes()), body);
433434
}
434435

0 commit comments

Comments
 (0)