[Mlir-commits] [mlir] 7b323af - [MLIR] Fix areIdsUnique in AffineStructures

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri May 13 03:51:24 PDT 2022


Author: Groverkss
Date: 2022-05-13T16:15:13+05:30
New Revision: 7b323af52abaf71afab6578540eca90004384535

URL: https://github.com/llvm/llvm-project/commit/7b323af52abaf71afab6578540eca90004384535
DIFF: https://github.com/llvm/llvm-project/commit/7b323af52abaf71afab6578540eca90004384535.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
index 619d9c7a9e7f..434a2bfdffc1 100644
--- a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
@@ -349,7 +349,8 @@ static bool LLVM_ATTRIBUTE_UNUSED areIdsUnique(
     return true;
 
   SmallPtrSet<Value, 8> uniqueIds;
-  ArrayRef<Optional<Value>> maybeValues = cst.getMaybeValues();
+  ArrayRef<Optional<Value>> maybeValues =
+      cst.getMaybeValues().slice(start, end - start);
   for (Optional<Value> val : maybeValues) {
     if (val.hasValue() && !uniqueIds.insert(val.getValue()).second)
       return false;


        


More information about the Mlir-commits mailing list