[PATCH] D108284: [DAGCombiner] Combine frem into fdiv+ftrunc+fma
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 20 07:33:03 PDT 2021
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14425
+ if (Flags.hasApproximateFuncs()) {
+ SDLoc Loc(N);
----------------
comment? // fold (frem x, y) -> (fma (fneg), y, x) ...
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14428
+ SDValue Div = DAG.getNode(ISD::FDIV, Loc, VT, N0, N1);
+ SDValue Trunc = DAG.getNode(ISD::FTRUNC, Loc, VT, Div);
+ return DAG.getNode(ISD::FMA, Loc, VT,
----------------
Should we check that ftrunc is available?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108284/new/
https://reviews.llvm.org/D108284
More information about the llvm-commits
mailing list