[Mlir-commits] [mlir] ab03a84 - [mlir][Analysis][NFC] Disambiguate FlatAffineConstraints constructor

Matthias Springer llvmlistbot at llvm.org
Mon Aug 9 18:37:05 PDT 2021


Author: Matthias Springer
Date: 2021-08-10T10:34:30+09:00
New Revision: ab03a84e2c7f7c0c51e855efae8c2aa9446f348d

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

LOG: [mlir][Analysis][NFC] Disambiguate FlatAffineConstraints constructor

The following constructor call (and others) used to be ambiguous:

```
FlatAffineConstraints constraints(0, 0, 0);
```

Differential Revision: https://reviews.llvm.org/D107726

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/AffineStructures.h
    mlir/unittests/Analysis/AffineStructuresTest.cpp
    mlir/unittests/Analysis/PresburgerSetTest.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/AffineStructures.h b/mlir/include/mlir/Analysis/AffineStructures.h
index 1d857d59c34f..92bee644e8c9 100644
--- a/mlir/include/mlir/Analysis/AffineStructures.h
+++ b/mlir/include/mlir/Analysis/AffineStructures.h
@@ -64,8 +64,8 @@ class FlatAffineConstraints {
   /// of constraints and identifiers..
   FlatAffineConstraints(unsigned numReservedInequalities,
                         unsigned numReservedEqualities,
-                        unsigned numReservedCols, unsigned numDims = 0,
-                        unsigned numSymbols = 0, unsigned numLocals = 0,
+                        unsigned numReservedCols, unsigned numDims,
+                        unsigned numSymbols, unsigned numLocals,
                         ArrayRef<Optional<Value>> idArgs = {})
       : numIds(numDims + numSymbols + numLocals), numDims(numDims),
         numSymbols(numSymbols),

diff  --git a/mlir/unittests/Analysis/AffineStructuresTest.cpp b/mlir/unittests/Analysis/AffineStructuresTest.cpp
index a0344a43e670..4fe46c342c29 100644
--- a/mlir/unittests/Analysis/AffineStructuresTest.cpp
+++ b/mlir/unittests/Analysis/AffineStructuresTest.cpp
@@ -56,8 +56,8 @@ static FlatAffineConstraints
 makeFACFromConstraints(unsigned ids, ArrayRef<SmallVector<int64_t, 4>> ineqs,
                        ArrayRef<SmallVector<int64_t, 4>> eqs,
                        unsigned syms = 0) {
-  FlatAffineConstraints fac(ineqs.size(), eqs.size(), ids + 1, ids - syms,
-                            syms);
+  FlatAffineConstraints fac(ineqs.size(), eqs.size(), ids + 1, ids - syms, syms,
+                            /*numLocals=*/0);
   for (const auto &eq : eqs)
     fac.addEquality(eq);
   for (const auto &ineq : ineqs)

diff  --git a/mlir/unittests/Analysis/PresburgerSetTest.cpp b/mlir/unittests/Analysis/PresburgerSetTest.cpp
index 20c56274b9be..ac065fa74879 100644
--- a/mlir/unittests/Analysis/PresburgerSetTest.cpp
+++ b/mlir/unittests/Analysis/PresburgerSetTest.cpp
@@ -84,7 +84,8 @@ static void testComplementAtPoints(PresburgerSet s,
 static FlatAffineConstraints
 makeFACFromConstraints(unsigned dims, ArrayRef<SmallVector<int64_t, 4>> ineqs,
                        ArrayRef<SmallVector<int64_t, 4>> eqs) {
-  FlatAffineConstraints fac(ineqs.size(), eqs.size(), dims + 1, dims);
+  FlatAffineConstraints fac(ineqs.size(), eqs.size(), dims + 1, dims,
+                            /*numSymbols=*/0, /*numLocals=*/0);
   for (const SmallVector<int64_t, 4> &eq : eqs)
     fac.addEquality(eq);
   for (const SmallVector<int64_t, 4> &ineq : ineqs)


        


More information about the Mlir-commits mailing list