Skip to content

Commit 7b323af

Browse files
committed
[MLIR] Fix areIdsUnique in AffineStructures
This patch fixes a bug in areIdsUnique where it ignores the [start, end] range. No test case is added since there are no use cases through IR from where it can be tested, and it is hard to create a unittest since we do not currently have Values in unittests. Reviewed By: arjunp Differential Revision: https://reviews.llvm.org/D124735
1 parent d9ad6a2 commit 7b323af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ static bool LLVM_ATTRIBUTE_UNUSED areIdsUnique(
349349
return true;
350350

351351
SmallPtrSet<Value, 8> uniqueIds;
352-
ArrayRef<Optional<Value>> maybeValues = cst.getMaybeValues();
352+
ArrayRef<Optional<Value>> maybeValues =
353+
cst.getMaybeValues().slice(start, end - start);
353354
for (Optional<Value> val : maybeValues) {
354355
if (val.hasValue() && !uniqueIds.insert(val.getValue()).second)
355356
return false;

0 commit comments

Comments
 (0)