[PATCH] D132837: [ISel] Enable generating more fma instructions.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 04:22:30 PDT 2022


foad added reviewers: spatel, cameron.mcinally, ohsallen, RKSimon, lebedev.ri.
foad added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14147
 
   // fadd (fma A, B, (fmul C, D)), E --> fma A, B, (fma C, D, E)
   // fadd E, (fma A, B, (fmul C, D)) --> fma A, B, (fma C, D, E)
----------------
This seems to be a more limited case of your new reassociation, so can we remove this code now?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14177
+  if (CanReassociate) {
+    auto IsCopyOrExtract = [](SDValue Val) {
+      return Val.getOpcode() == ISD::CopyFromReg ||
----------------
I don't understand the logic here. What do copies and extracts have to do with reassociating fmuls and fadds?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132837



More information about the llvm-commits mailing list