Lunderberg commented on a change in pull request #9727:
URL: https://github.com/apache/tvm/pull/9727#discussion_r779824817
##########
File path: src/tir/transforms/lower_custom_datatypes.cc
##########
@@ -103,32 +103,59 @@ class CustomDatatypesLowerer : public StmtExprMutator {
}
}
- PrimExpr VisitExpr_(const LoadNode* load) final {
- bool to_be_lowered =
datatype::Registry::Global()->GetTypeRegistered(load->dtype.code());
- PrimExpr expr = StmtExprMutator::VisitExpr_(load);
- load = expr.as<LoadNode>();
- if (to_be_lowered) {
- auto new_load_type = DataType::UInt(load->dtype.bits());
- auto buffer_var = load->buffer_var;
- auto it = var_remap_.find(buffer_var);
- if (it != var_remap_.end()) {
- buffer_var = it->second;
- }
- return Load(new_load_type, buffer_var, load->index, load->predicate);
- }
- return expr;
+ PrimExpr VisitExpr_(const LoadNode* op) final {
+ LOG(FATAL) << "Unexpected use of deprecated LoadNode. Please use
BufferLoadNode instead.";
Review comment:
Not strictly needed, but I kept them in to show that their exclusion was
intentional, without needing to look elsewhere in the codebase. Otherwise,
somebody might see that a particular pass doesn't handle `LoadNode*` and
unnecessarily add it back in. Since the LoadNode constructor also throws an
error, I'm also okay with removing these visitors, as any use would be caught
by unit tests.
--
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]