[mlir][math]Expand Fused math.fmaf to a multiply-add
authorBalaji V. Iyer <bviyer@gmail.com>
Fri, 7 Apr 2023 21:47:20 +0000 (21:47 +0000)
committerRobert Suderman <suderman@google.com>
Fri, 7 Apr 2023 22:14:56 +0000 (22:14 +0000)
commita7c2102d988b2ae2214f1483d2b4066955b4dc98
tree4d163e2f873aa10cb8fee1a5df697d71bc0f93b5
parentdf9af1fe7c9ce7ce6bc3e55c504d25c59ad83a87
[mlir][math]Expand Fused math.fmaf to a multiply-add

Fused multiply and add are being pushed directly to the libm. This is problematic
for situations where libm is not available. This patch will break down a fused multiply and
add into a multiply followed by an add.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D147811
mlir/include/mlir/Dialect/Math/Transforms/Passes.h
mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp
mlir/test/Dialect/Math/expand-math.mlir
mlir/test/lib/Dialect/Math/TestExpandMath.cpp