slyubomirsky commented on code in PR #16655:
URL: https://github.com/apache/tvm/pull/16655#discussion_r1520813519
##########
src/tir/ir/tir_visitor_with_path.cc:
##########
@@ -250,7 +236,8 @@ void TIRVisitorWithPath::VisitStmt_(const BufferStoreNode*
op, ObjectPath path)
void TIRVisitorWithPath::VisitStmt_(const BufferRealizeNode* op, ObjectPath
path) {
Visit(op->condition, path->Attr("condition"));
Visit(op->bounds, path->Attr("bounds"));
- auto context = WithDef(op->buffer, path->Attr("buffer"));
+ auto context = WithDefIfUndefined(op->buffer->data,
path->Attr("buffer")->Attr("data"));
Review Comment:
I imagine this accounts for the case where a BufferRealize can act as a
point of definition?
##########
src/tir/ir/tir_visitor_with_path.cc:
##########
@@ -199,12 +174,23 @@ void TIRVisitorWithPath::VisitStmt_(const LetStmtNode*
op, ObjectPath path) {
void TIRVisitorWithPath::VisitStmt_(const AttrStmtNode* op, ObjectPath path) {
Visit(op->value, path->Attr("value"));
- std::optional<DefContext<IterVar>> context = std::nullopt;
+ std::vector<std::variant<DefContext<IterVar>, DefContext<Var>>> context;
if (auto iter_var = op->node.as<IterVar>();
iter_var && (op->attr_key == attr::thread_extent || op->attr_key ==
attr::virtual_thread)) {
// Some attributes serve as a source of definition for the
// tir::Var they annotate.
- context = WithDef(iter_var.value(), path->Attr("node"));
+ context.push_back(WithDef(iter_var.value(), path->Attr("node")));
+ } else if (op->attr_key == attr::buffer_bind_scope) {
Review Comment:
Probably worth commenting that this acts as an older form of MatchBuffer,
per the PR description.
##########
src/tir/ir/tir_visitor_with_path.cc:
##########
@@ -199,12 +174,23 @@ void TIRVisitorWithPath::VisitStmt_(const LetStmtNode*
op, ObjectPath path) {
void TIRVisitorWithPath::VisitStmt_(const AttrStmtNode* op, ObjectPath path) {
Visit(op->value, path->Attr("value"));
- std::optional<DefContext<IterVar>> context = std::nullopt;
+ std::vector<std::variant<DefContext<IterVar>, DefContext<Var>>> context;
Review Comment:
Is this ever used? I don't see any reads from it.
--
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]