[all-commits] [llvm/llvm-project] 84d07d: [MLIR][Presburger] Improve unittest parsing

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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 84d07d021333f7b5716f0444d5c09105557272e0
      https://github.com/llvm/llvm-project/commit/84d07d021333f7b5716f0444d5c09105557272e0
  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.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

  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