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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 12 03:03:25 PDT 2020


lebedev.ri 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())) {
----------------
steven.zhang wrote:
> 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. 
Err, i mean, why `Aggressive` check is there?


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