gemini-code-assist[bot] commented on code in PR #18876:
URL: https://github.com/apache/tvm/pull/18876#discussion_r2893283045
##########
src/s_tir/backend/adreno/inject_texture_alloc.cc:
##########
@@ -82,9 +82,11 @@ class TextureAllocInjector : public
arith::IRMutatorWithAnalyzer {
args.push_back(Call(DataType::Handle(), builtin::tvm_stack_make_shape(),
{texture.width, texture.height, texture.depth}));
args.push_back(IntImm(DataType::Int(64), channel_size));
- stmt = SeqStmt({Bind(op->buffer->data, Call(op->buffer->data.dtype(),
-
builtin::nd_mem_alloc_with_scope(), args)),
- op->body});
+ ffi::Array<Stmt> seq;
+ seq.push_back(stmt);
+ seq.push_back(Bind(op->buffer->data,
+ Call(op->buffer->data.dtype(),
builtin::nd_mem_alloc_with_scope(), args)));
+ stmt = SeqStmt(seq);
Review Comment:

This pass appears to be lowering `AllocBuffer` to a `Bind` statement that
performs the actual memory allocation. However, the current implementation
replaces the `AllocBuffer` node with a `SeqStmt` containing both the original
`AllocBuffer` and the new `Bind` statement. This seems redundant, as the
`AllocBuffer` is a high-level construct that this lowering pass should replace.
Other lowering passes in this PR (e.g., `LowerVtcmAlloc`) replace
`AllocBuffer` with just a `Bind` statement. To be consistent and avoid
redundancy, this pass should probably do the same.
```suggestion
stmt = Bind(op->buffer->data,
Call(op->buffer->data.dtype(),
builtin::nd_mem_alloc_with_scope(), args));
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]