[Mlir-commits] [mlir] [MLIR][Presburger] Use Identifiers outside Presburger library (PR #77316)

Bharathi Ramana Joshi llvmlistbot at llvm.org
Fri Apr 5 20:19:49 PDT 2024


================
@@ -217,11 +219,11 @@ class FlatLinearValueConstraints : public FlatLinearConstraints {
       : FlatLinearConstraints(numReservedInequalities, numReservedEqualities,
                               numReservedCols, numDims, numSymbols, numLocals) {
     assert(valArgs.empty() || valArgs.size() == getNumDimAndSymbolVars());
-    values.reserve(numReservedCols);
-    if (valArgs.empty())
-      values.resize(getNumDimAndSymbolVars(), std::nullopt);
-    else
-      values.append(valArgs.begin(), valArgs.end());
+    // Store Values in space's identifiers.
+    space.resetIds();
+    for (unsigned i = 0, e = valArgs.size(); i < e; ++i)
+      if (valArgs[i])
+        setValue(i, *valArgs[i]);
----------------
iambrj wrote:

added comment in FlatLinearValueConstraints' constructor [here](https://github.com/llvm/llvm-project/pull/77316/files#diff-e77afb47e1a45788a8eb369ae11eb5303a9d0c554b7686bb7baf1dae1f5372beR208)

https://github.com/llvm/llvm-project/pull/77316


More information about the Mlir-commits mailing list