[Mlir-commits] [mlir] mlir/Presburger: contribute a free-standing parser (PR #94916)

Jay Foad llvmlistbot at llvm.org
Thu Jun 27 01:26:22 PDT 2024


================
@@ -0,0 +1,67 @@
+//===- Flattener.h - Presburger ParseStruct Flattener -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_ANALYSIS_PRESBURGER_PARSER_FLATTENER_H
+#define MLIR_ANALYSIS_PRESBURGER_PARSER_FLATTENER_H
+
+#include "ParseStructs.h"
+#include "mlir/Analysis/Presburger/IntegerRelation.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SetVector.h"
+
+namespace mlir::presburger {
+using llvm::SmallDenseMap;
+using llvm::SmallSetVector;
+
+class Flattener : public FinalParseResult {
+public:
+  // The final flattened result is stored here.
+  IntMatrix flatMatrix;
+
+  // We maintain a set of divs that we have seen while flattening. The size of
+  // this set we at most info.numDivs, hitting info.numDivs at the end of the
----------------
jayfoad wrote:

```suggestion
  // this set is at most info.numDivs, hitting info.numDivs at the end of the
```

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


More information about the Mlir-commits mailing list