[Mlir-commits] [mlir] 1e0d7fd - Fix asserts as suggested by Arjun

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 2 13:59:13 PST 2021


Author: Groverkss
Date: 2021-12-03T03:23:20+05:30
New Revision: 1e0d7fd76968aee2eb012a9f95642f905b4d2613

URL: https://github.com/llvm/llvm-project/commit/1e0d7fd76968aee2eb012a9f95642f905b4d2613
DIFF: https://github.com/llvm/llvm-project/commit/1e0d7fd76968aee2eb012a9f95642f905b4d2613.diff

LOG: Fix asserts as suggested by Arjun

Added: 
    

Modified: 
    mlir/lib/Analysis/AffineStructures.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp
index 8ef25bae3659..1252a73f1f0d 100644
--- a/mlir/lib/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Analysis/AffineStructures.cpp
@@ -1925,8 +1925,8 @@ void FlatAffineConstraints::removeRedundantConstraints() {
 static void eleminateRedundantLocalId(FlatAffineConstraints &fac, unsigned pos1,
                                       unsigned pos2) {
 
-  assert(pos1 <= fac.getNumLocalIds() && "Invalid local id position");
-  assert(pos2 <= fac.getNumLocalIds() && "Invalid local id position");
+  assert(pos1 < fac.getNumLocalIds() && "Invalid local id position");
+  assert(pos2 < fac.getNumLocalIds() && "Invalid local id position");
 
   unsigned localOffset = fac.getNumDimAndSymbolIds();
   pos1 += localOffset;


        


More information about the Mlir-commits mailing list