[PATCH] D75982: [DAGCombine] Respect the uses when combine FMA for a*b+/-c*d

qshanz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 02:20:02 PDT 2020


steven.zhang marked an inline comment as done.
steven.zhang added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:11923
+  // prefer to fold the multiply with fewer uses.
+  if (Aggressive && isContractableFMUL(N0) && isContractableFMUL(N1) &&
+      (N0.getNode()->use_size() > N1.getNode()->use_size())) {
----------------
lebedev.ri wrote:
> I'm not sure why `Aggressive && isContractableFMUL(N0) && isContractableFMUL(N1)` check is here?
> That is already checked in the lambdas.
Only when both operands(LHS/RHS) are FMUL we should respect the uses to decide on folding which one,  Therefore, we need the check here. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75982





More information about the llvm-commits mailing list