Lunderberg commented on a change in pull request #9727:
URL: https://github.com/apache/tvm/pull/9727#discussion_r770692650
##########
File path: src/tir/transforms/ir_utils.cc
##########
@@ -111,26 +111,56 @@ class IRConvertSSA final : public StmtExprMutator {
return StmtExprMutator::VisitExpr_(op);
}
}
+
PrimExpr VisitExpr_(const LoadNode* op) final {
- PrimExpr expr = StmtExprMutator::VisitExpr_(op);
- op = expr.as<LoadNode>();
- const VarNode* v = op->buffer_var.get();
- if (scope_.count(v) && !scope_[v].empty()) {
- return Load(op->dtype, scope_[v].back(), op->index, op->predicate);
- } else {
- return expr;
- }
+ LOG(FATAL) << "Unexpected use of deprecated LoadNode. Please use
BufferLoadNode instead.";
+ return PrimExpr();
}
+
Stmt VisitStmt_(const StoreNode* op) final {
- Stmt stmt = StmtExprMutator::VisitStmt_(op);
- op = stmt.as<StoreNode>();
- const VarNode* v = op->buffer_var.get();
- if (scope_.count(v) && !scope_[v].empty()) {
- return Store(scope_[v].back(), op->value, op->index, op->predicate);
- } else {
- return stmt;
+ LOG(FATAL) << "Unexpected use of deprecated StoreNode. Please use
BufferStoreNode instead.";
+ return Stmt();
+ }
+
+ PrimExpr VisitExpr_(const BufferLoadNode* op) final {
+ auto node = Downcast<BufferLoad>(StmtExprMutator::VisitExpr_(op));
+ return VisitBufferAccess(node);
+ }
+
+ Stmt VisitStmt_(const BufferStoreNode* op) final {
+ auto node = Downcast<BufferStore>(StmtExprMutator::VisitStmt_(op));
+ return VisitBufferAccess(node);
Review comment:
Thank you, updated here as well.
--
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]