[PATCH] D11855: SelectionDAG: Prefer to combine multiplication with less uses for fma

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 17:44:11 PDT 2015


arsenm added a subscriber: arsenm.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7429-7430
@@ -7428,1 +7428,4 @@
 
+  // if we have two choice trying to fold (fadd (fmul u, v), (fmul x, y)) anyway, prefer to
+  // fold the multiplication with less use.
+  if (Aggressive && N0.getOpcode() == ISD::FMUL &&
----------------
Grammar fixes: "If we have two choices trying to fold (fadd (fmul u, v), (fmul x, y)), prefer to fold the multiply with fewer uses"

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7434-7435
@@ +7433,4 @@
+    if (N0.getNode()->use_size() > N1.getNode()->use_size()) {
+      using std::swap;
+      swap(N0, N1);
+    }
----------------
Just use std::swap without using


http://reviews.llvm.org/D11855





More information about the llvm-commits mailing list