[PATCH] [AArch64] Combine multiple FDIVs with the same divisor

hfinkel at anl.gov hfinkel at anl.gov
Thu Nov 20 19:36:45 PST 2014


Please change how the comparison is done as noted below, otherwise LGTM.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7115
@@ +7114,3 @@
+  if (Options.UnsafeFPMath) {
+    SDValue FPOne = DAG.getConstantFP(1.0, VT); // floating point 1.0
+    // Skip if current node is a reciprocal.
----------------
Don't do the comparison by creating new nodes. You can:

  if (auto *CN0 = dyn_cast<ConstantFPSDNode>(N0)) {
    if (CN0->isExactlyValue(1.0))
      return SDValue();
  }

Create the FPOne later if you need it.

http://reviews.llvm.org/D6334






More information about the llvm-commits mailing list