[PATCH] D39282: DAG: Fold fma (fneg x), K, y -> fma x, -K, y

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 02:58:41 PDT 2017


RKSimon added a reviewer: RKSimon.
RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:10128
+    // fma (fneg x), K, y -> fma x -K, y
+    if (N0.getOpcode() == ISD::FNEG) {
+      return DAG.getNode(ISD::FMA, DL, VT, N0.getOperand(0),
----------------
Do we need a OneUse test on FNEG(N0)?


https://reviews.llvm.org/D39282





More information about the llvm-commits mailing list