Implement unrolling of vector ops to finer-grained vector ops as a pattern.
authorNicolas Vasilache <ntv@google.com>
Wed, 20 Nov 2019 18:54:45 +0000 (10:54 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 20 Nov 2019 19:49:36 +0000 (11:49 -0800)
commitfa14d4f6ab2ec069e43314a1769d21f374ccb4bd
tree242c890b2347ebb3d6981d9534c804399ceb0698
parenteb418559ef29716cc34c891c93490c38ac5ea1dd
Implement unrolling of vector ops to finer-grained vector ops as a pattern.

This CL uses the pattern rewrite infrastructure to implement a simple VectorOps -> VectorOps legalization strategy to unroll coarse-grained vector operations into finer grained ones.
The transformation is written using local pattern rewrites to allow composition with other rewrites. It proceeds by iteratively introducing fake cast ops and cleaning canonicalizing or lowering them away where appropriate.

This is an example of writing transformations as compositions of local pattern rewrites that should enable us to make them significantly more declarative.

PiperOrigin-RevId: 281555100
13 files changed:
mlir/include/mlir/Analysis/VectorAnalysis.h
mlir/include/mlir/Conversion/VectorConversions/VectorConversions.h
mlir/include/mlir/Dialect/VectorOps/CMakeLists.txt
mlir/include/mlir/Dialect/VectorOps/VectorTransformPatterns.td [new file with mode: 0644]
mlir/lib/Analysis/VectorAnalysis.cpp
mlir/lib/Conversion/VectorConversions/CMakeLists.txt
mlir/lib/Conversion/VectorConversions/VectorToVector.cpp [new file with mode: 0644]
mlir/lib/Transforms/MaterializeVectors.cpp
mlir/test/Conversion/VectorConversions/vector-to-vector.mlir [new file with mode: 0644]
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestVectorToVectorConversion.cpp [new file with mode: 0644]
mlir/test/lib/Transforms/TestVectorizationUtils.cpp
mlir/tools/mlir-opt/CMakeLists.txt