Refactor vectorization patterns
authorNicolas Vasilache <ntv@google.com>
Fri, 29 Mar 2019 16:34:06 +0000 (09:34 -0700)
committerjpienaar <jpienaar@google.com>
Sat, 30 Mar 2019 00:55:36 +0000 (17:55 -0700)
commit094ca64ab06359437524712e65669a10bac816a7
treecced22e70f019f4075904e2e6c8b1670f7c03217
parent3ddd0411d06a3fd4784ef5de4dee879722ccab0d
Refactor vectorization patterns

This CL removes the reliance of the vectorize pass on the specification of a `fastestVaryingDim` parameter. This parameter is a restriction meant to more easily target a particular loop/memref combination for vectorization and is mainly used for testing.

This also had the side-effect of restricting vectorization patterns to only the ones in which all memrefs were contiguous along the same loop dimension. This simple restriction prevented matmul to vectorize in 2-D.

this CL removes the restriction and adds the matmul test which vectorizes in 2-D along the parallel loops. Support for reduction loops is left for future work.

PiperOrigin-RevId: 240993827
mlir/include/mlir/Analysis/LoopAnalysis.h
mlir/lib/Analysis/LoopAnalysis.cpp
mlir/lib/Analysis/VectorAnalysis.cpp
mlir/lib/Transforms/Vectorize.cpp
mlir/test/Transforms/Vectorize/vectorize_2d.mlir