[mlir] [VectorOps] Progressively lower vector.outerproduct to LLVM
authoraartbik <ajcbik@google.com>
Thu, 12 Mar 2020 20:10:47 +0000 (13:10 -0700)
committeraartbik <ajcbik@google.com>
Thu, 12 Mar 2020 20:45:42 +0000 (13:45 -0700)
commit078776a679b94c1fc970febe3c72f0b337af9a97
tree10c6c207d1a9241ce6acf4f67c5d353f5eb0fb74
parent9f5d9bf2470d2fe479581a81bc46e6e07a2f140e
[mlir] [VectorOps] Progressively lower vector.outerproduct to LLVM

Summary:
This replaces the direct lowering of vector.outerproduct to LLVM with progressive lowering into elementary vectors ops to avoid having the similar lowering logic at several places.

NOTE1: with the new progressive rule, the lowered llvm is slightly more elaborate than with the direct lowering, but the generated assembly is just as optimized; still if we want to stay closer to the original, we should add a "broadcast on extract" to shuffle rewrite (rather than special cases all the lowering steps)

NOTE2: the original outerproduct lowering code should now be removed but some linalg test work directly on vector and contain some dead code, so this requires another CL

Reviewers: nicolasvasilache, andydavis1

Reviewed By: nicolasvasilache, andydavis1

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75956
mlir/include/mlir/Dialect/VectorOps/VectorOps.h
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/lib/Dialect/VectorOps/VectorTransforms.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Dialect/VectorOps/vector-contract-transforms.mlir