Skip to content

Commit 9a19cf6

Browse files
author
wrongtest
committed
fix trivial index map [] -> [0]
1 parent 5e12a5c commit 9a19cf6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/tir/ir/index_map.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Array<Range> IndexMapNode::MapRanges(const Array<Range>& ranges, arith::Analyzer
218218
}
219219
}
220220
auto output_dtype = [&]() {
221-
int max_bits = 0;
221+
int max_bits = ranges.empty() ? 32 : 0;
222222
for (const auto& range : ranges) {
223223
max_bits = std::max(max_bits, range->extent.dtype().bits());
224224
}

src/tir/schedule/primitive/layout_transformation.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,10 @@ void TransformBlockLayout(ScheduleState self, const StmtSRef& block_sref,
14641464
}
14651465

14661466
// Step 6: Do the actual replacement
1467+
if (scope_sref->StmtAs<BlockNode>()) {
1468+
ICHECK(new_loop_vars.empty()) << "Invalid block to loop replacement due to layout transform "
1469+
<< index_map;
1470+
}
14671471
self->Replace(scope_sref, body, {{block, new_block}});
14681472
}
14691473

0 commit comments

Comments
 (0)