Skip to content

Commit

Permalink
[Unity] Fix IndexDataTypeNormalizer so that it correctly handles corn…
Browse files Browse the repository at this point in the history
…er case (#16245)

fix
  • Loading branch information
jinhongyii authored Dec 15, 2023
1 parent cd9445d commit a2e19d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tir/ir/data_type_rewriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,11 @@ IndexDataTypeNormalizer::IndexDataTypeNormalizer(DataType target_data_type)
: target_data_type_(std::move(target_data_type)) {}

PrimFunc IndexDataTypeNormalizer::Rewrite(PrimFunc func) {
// collect var remap
VisitStmt(std::move(func->body));
buffer_remap_.clear();
ivmap_.clear();
// start rewrite
Map<Var, Buffer> new_buffer_map = func->buffer_map;
for (const auto& [var, buffer] : func->buffer_map) {
new_buffer_map.Set(var, VisitBuffer(buffer));
Expand Down

0 comments on commit a2e19d2

Please sign in to comment.