[Matrix] Use fmuladd for matrix.multiply if allowed.
authorFlorian Hahn <flo@fhahn.com>
Mon, 23 Dec 2019 13:28:56 +0000 (14:28 +0100)
committerFlorian Hahn <flo@fhahn.com>
Mon, 23 Dec 2019 13:49:14 +0000 (14:49 +0100)
commit8d6f59b78a83489d3dacdd4db0dbf1d4213c92b7
tree437d358caad703ce49bcf79ae7f20a18a6252a67
parenteca40066ebb5759aa44d21833c7a1fd7dd2361af
[Matrix] Use fmuladd  for matrix.multiply if allowed.

If the matrix.multiply calls have the contract fast math flag, we can
use fmuladd. This als adds a command line option to force fmuladd
generation. We can retire this option once there is a clang-level
option.

Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D70951
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
llvm/test/Transforms/LowerMatrixIntrinsics/multiply-double-contraction-fmf.ll [new file with mode: 0644]
llvm/test/Transforms/LowerMatrixIntrinsics/multiply-double-contraction.ll [new file with mode: 0644]
llvm/test/Transforms/LowerMatrixIntrinsics/multiply-float-contraction-fmf.ll [new file with mode: 0644]
llvm/test/Transforms/LowerMatrixIntrinsics/multiply-float-contraction.ll [new file with mode: 0644]