[PATCH] D108619: [DAGCombine] Allow FMA combine with both FMA and FMAD

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 25 06:19:51 PDT 2021


foad accepted this revision.
foad added a comment.
This revision is now accepted and ready to land.

Looks fine to me, with or without the tweak suggested inline.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13107
     SDValue CDE = DAG.getNode(PreferredFusedOpcode, SL, VT, C, D, E);
     return DAG.getNode(PreferredFusedOpcode, SL, VT, A, B, CDE);
   }
----------------
Could use `FMA.getOpcode()` instead of `PreferredFusedOpcode` here, to try to preserve the original opcode  of the `A*B+something` part of the expression. But that's getting pretty subtle and I'm not sure if it will make any practical difference.

The same goes for any other parts of combines which preserve an fma(d) instead of creating a new one from scratch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108619/new/

https://reviews.llvm.org/D108619



More information about the llvm-commits mailing list