[mlir][VectorOps] Introduce a `vector.fma` op that works on n-D vectors and lowers...
authorNicolas Vasilache <ntv@google.com>
Fri, 7 Feb 2020 20:39:43 +0000 (15:39 -0500)
committerNicolas Vasilache <ntv@google.com>
Fri, 7 Feb 2020 20:44:53 +0000 (15:44 -0500)
commit681f929f591616ca048aa470d030d985b6719216
treef8488171cc21eacbe0e26219c745f542cd4ab206
parent26bf877ec5ce07eaaf2ebf19e78f26fa59a8e41a
[mlir][VectorOps] Introduce a `vector.fma` op that works on n-D vectors and lowers to `llvm.intrin.fmuladd`

Summary:
The `vector.fma` operation is portable enough across targets that we do not want
to keep it wrapped under `vector.outerproduct` and `llvm.intrin.fmuladd`.
This revision lifts the op into the vector dialect and implements the lowering to LLVM by using two patterns:
1. a pattern that lowers from n-D to (n-1)-D by unrolling when n > 2
2. a pattern that converts from 1-D to the proper LLVM representation

Reviewers: ftynse, stellaraccident, aartbik, dcaballe, jsetoain, tetuante

Reviewed By: aartbik

Subscribers: fhahn, dcaballe, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74075
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Dialect/VectorOps/ops.mlir