[PATCH] DAGCombiner: Continue combining if FoldConstantArithmetic() fails.

Ahmed Bougacha ahmed.bougacha at gmail.com
Mon Jan 12 20:02:02 PST 2015


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1572
@@ +1571,3 @@
+  if (N0C && N1C) {
+    SDValue Folded = DAG.FoldConstantArithmetic(ISD::ADD, VT, N0C, N1C);
+    if (Folded.getNode())
----------------
How about:

    if (SDValue Folded = ...)
      return Folded;

Or going further, you could remove the N0C && N1C check, since FoldConstantArithmetic also does it (a sliver more wasteful though).

http://reviews.llvm.org/D6946

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list