[all-commits] [llvm/llvm-project] 86f255: [MLIR][Presburger] Make constructors from Presburg...

Kunwar Shaanjeet Singh Grover via All-commits all-commits at lists.llvm.org
Sat Apr 2 06:01:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 86f255360c4f1741e8c5bef95e6994b81cd8d2e1
      https://github.com/llvm/llvm-project/commit/86f255360c4f1741e8c5bef95e6994b81cd8d2e1
  Author: Groverkss <groverkss at gmail.com>
  Date:   2022-04-02 (Sat, 02 Apr 2022)

  Changed paths:
    M mlir/include/mlir/Analysis/Presburger/IntegerRelation.h
    M mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h

  Log Message:
  -----------
  [MLIR][Presburger] Make constructors from PresburgerSpace explicit

This patch makes constructors of IntegerRelation, IntegerPolyhedron,
PresburgerRelation, PresburgerSet from PresburgerSpace explicit. This
prevents bugs like:

```
void fun(IntegerRelation a, IntegerRelation b) {
  IntegerPolyhedron c = a.intersect(b);
}
```

Here, `a.intersect(b)` will return `IntegerRelation`, which will be implicitly
converted to `PresburgerSpace` and will use the `PresburgerSpace` constructor
for IntegerPolyhedron. Leading to loss of any constraints in the intersection
of `a` and `b`. After this patch, this will give a compile error.

Reviewed By: arjunp

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




More information about the All-commits mailing list