Skip to content

Commit ce9d196

Browse files
committed
Explicitly check for duplicate index
1 parent bc06e7c commit ce9d196

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/relax/transform/fuse_tir.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ class FusedTIRConstructor : public ExprVisitor {
467467
// (i.e., already listed in the buffer map. This would result
468468
// in duplicates in the buffer map otherwise)
469469
if (auto it = buffer_to_idx.find(buffers[i]); it != buffer_to_idx.end()) {
470-
inplace_indices_.insert((*it).second);
470+
auto idx = (*it).second;
471+
CHECK(!inplace_indices_.count(idx))
472+
<< "In-place index " << idx << " used twice! An argument must be aliased.";
473+
inplace_indices_.insert(idx);
471474
continue;
472475
}
473476

0 commit comments

Comments
 (0)