[all-commits] [llvm/llvm-project] 8e8b70: [mlir][scf] Simplify affine.min ops after loop pee...

Matthias Springer via All-commits all-commits at lists.llvm.org
Thu Aug 19 01:25:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e8b70aa8479e44c5a9a09ea832857d51f3faa6d
      https://github.com/llvm/llvm-project/commit/8e8b70aa8479e44c5a9a09ea832857d51f3faa6d
  Author: Matthias Springer <springerm at google.com>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M mlir/include/mlir/Analysis/AffineStructures.h
    M mlir/include/mlir/Dialect/SCF/Transforms.h
    M mlir/include/mlir/IR/AffineExpr.h
    M mlir/include/mlir/IR/AffineMap.h
    M mlir/lib/Analysis/AffineStructures.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
    M mlir/lib/IR/AffineExpr.cpp
    M mlir/test/Dialect/SCF/for-loop-peeling.mlir
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][scf] Simplify affine.min ops after loop peeling

Simplify affine.min ops, enabling various other canonicalizations inside the peeled loop body.

affine.min ops such as:
```
map = affine_map<(d0)[s0, s1] -> (s0, -d0 + s1)>
%r = affine.min #affine.min #map(%iv)[%step, %ub]
```
are rewritten them into (in the case the peeled loop):
```
%r = %step
```

To determine how an affine.min op should be rewritten and to prove its correctness, FlatAffineConstraints is utilized.

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




More information about the All-commits mailing list