[all-commits] [llvm/llvm-project] 8c867f: [MLIR][Presburger] Improve unittest parsing

Kunwar Shaanjeet Singh Grover via All-commits all-commits at lists.llvm.org
Thu Sep 15 11:29:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c867f7827f618e2a3164235ef91725199dd76f1
      https://github.com/llvm/llvm-project/commit/8c867f7827f618e2a3164235ef91725199dd76f1
  Author: Groverkss <groverkss at gmail.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M mlir/include/mlir/AsmParser/AsmParser.h
    M mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
    M mlir/lib/AsmParser/AffineParser.cpp
    M mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
    M mlir/unittests/Analysis/Presburger/CMakeLists.txt
    M mlir/unittests/Analysis/Presburger/IntegerPolyhedronTest.cpp
    M mlir/unittests/Analysis/Presburger/IntegerRelationTest.cpp
    M mlir/unittests/Analysis/Presburger/PWMAFunctionTest.cpp
    A mlir/unittests/Analysis/Presburger/Parser.h
    A mlir/unittests/Analysis/Presburger/ParserTest.cpp
    M mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp
    M mlir/unittests/Analysis/Presburger/SimplexTest.cpp
    M mlir/unittests/Analysis/Presburger/Utils.h
    R mlir/unittests/Dialect/Affine/Analysis/AffineStructuresParser.cpp
    R mlir/unittests/Dialect/Affine/Analysis/AffineStructuresParser.h
    R mlir/unittests/Dialect/Affine/Analysis/AffineStructuresParserTest.cpp
    R mlir/unittests/Dialect/Affine/Analysis/CMakeLists.txt
    R mlir/unittests/Dialect/Affine/CMakeLists.txt
    M mlir/unittests/Dialect/CMakeLists.txt
    M utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel

  Log Message:
  -----------
  [MLIR][Presburger] Improve unittest parsing

This patch adds better functions for parsing MultiAffineFunctions and
PWMAFunctions in Presburger unittests.

A PWMAFunction can now be parsed as:

```
PWMAFunction result = parsePWMAF({
    {"(x, y) : (x >= 10, x <= 20, y >= 1)", "(x, y) -> (x + y)"},
    {"(x, y) : (x >= 21)", "(x, y) -> (x + y)"},
    {"(x, y) : (x <= 9)", "(x, y) -> (x - y)"},
    {"(x, y) : (x >= 10, x <= 20, y <= 0)", "(x, y) -> (x - y)"},
});
```

which is much more readable than the old format since the output can be
described as an AffineMap, instead of coefficients.

This patch also adds support for parsing divisions in MultiAffineFunctions
and PWMAFunctions which was previously not possible.

Reviewed By: arjunp

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




More information about the All-commits mailing list