[mlir][Linalg] Enable vectorization of explicit broadcasts
authorDiego Caballero <diegocaballero@google.com>
Tue, 12 Oct 2021 20:58:06 +0000 (20:58 +0000)
committerDiego Caballero <diegocaballero@google.com>
Tue, 12 Oct 2021 21:08:22 +0000 (21:08 +0000)
commit5c1d356c18c3ef9e63cf9607af660fb0b1c8a6ca
treeb5534c93cc2c701e52448e0c34b1d43560e4bbf2
parentf09dce564e9cdea6e4b2803682b61fdd8bf4d094
[mlir][Linalg] Enable vectorization of explicit broadcasts

This patch teaches `isProjectedPermutation` and `inverseAndBroadcastProjectedPermutation`
utilities to deal with maps representing an explicit broadcast, e.g., (d0, d1) -> (d0, 0).
This extension is needed to enable vectorization of such explicit broadcast in Linalg.

Reviewed By: pifon2a, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D111563
mlir/include/mlir/IR/AffineMap.h
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/lib/IR/AffineMap.cpp
mlir/test/Dialect/Linalg/vectorization.mlir