[PATCH] D96614: [AMDGPU][GlobalISel] Transform (fsub (fmul x, y), z) -> (fma x, y, -z)
Mateja Marjanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 4 07:09:49 PDT 2021
matejam added a comment.
In D96614#2787052 <https://reviews.llvm.org/D96614#2787052>, @foad wrote:
> Does this assume that all targets can do the fneg for free? Or can a target choose to fold only `(fadd (fmul x, y), z)`, not `(fsub (fmul x, y), z)` ?
Similar to SelectionDAG which negates an SDValue:
fold (fsub (fmul x, y), z) -> (fma x, y, (fneg z))
DAG.getNode(PreferredFusedOpcode, SL, VT, XY.getOperand(0),
XY.getOperand(1), DAG.getNode(ISD::FNEG, SL, VT, Z));
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96614/new/
https://reviews.llvm.org/D96614
More information about the llvm-commits
mailing list