[mlir] Affine: parallelize affine loops with reductions
authorAlex Zinenko <zinenko@google.com>
Thu, 29 Apr 2021 11:14:58 +0000 (13:14 +0200)
committerAlex Zinenko <zinenko@google.com>
Thu, 29 Apr 2021 11:16:24 +0000 (13:16 +0200)
commit545fa37834ef6b5731444728c00e7a18d4f1aeed
treea63c46b0374f66bbdfb0107471c735191d0c9515
parentde94b1855c63f8357bc7ae6668996c4a42d2b5be
[mlir] Affine: parallelize affine loops with reductions

Introduce a basic support for parallelizing affine loops with reductions
expressed using iteration arguments. Affine parallelism detector now has a flag
to assume such reductions are parallel. The transformation handles a subset of
parallel reductions that are can be expressed using affine.parallel:
integer/float addition and multiplication. This requires to detect the
reduction operation since affine.parallel only supports a fixed set of
reduction operators.

Reviewed By: chelini, kumasento, bondhugula

Differential Revision: https://reviews.llvm.org/D101171
mlir/include/mlir/Analysis/AffineAnalysis.h
mlir/include/mlir/Analysis/Utils.h
mlir/include/mlir/Dialect/Affine/Passes.td
mlir/include/mlir/Dialect/Affine/Utils.h
mlir/lib/Analysis/AffineAnalysis.cpp
mlir/lib/Analysis/Utils.cpp
mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp
mlir/lib/Dialect/Affine/Utils/CMakeLists.txt
mlir/lib/Dialect/Affine/Utils/Utils.cpp
mlir/test/Dialect/Affine/parallelize.mlir