Skip to content

Commit

Permalink
Explicitly check for duplicate index
Browse files Browse the repository at this point in the history
  • Loading branch information
slyubomirsky committed Feb 6, 2024
1 parent 3b44ff1 commit 111f08e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/relax/transform/fuse_tir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ class FusedTIRConstructor : public ExprVisitor {
// (i.e., already listed in the buffer map. This would result
// in duplicates in the buffer map otherwise)
if (auto it = buffer_to_idx.find(buffers[i]); it != buffer_to_idx.end()) {
inplace_indices_.insert((*it).second);
auto idx = (*it).second;
CHECK(!inplace_indices_.count(idx))
<< "In-place index " << idx << " used twice! An argument must be aliased.";
inplace_indices_.insert(idx);
continue;
}

Expand Down

0 comments on commit 111f08e

Please sign in to comment.