[PATCH] D87037: [DAGCombiner] Propagate FMF flags in FMA folding

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 19:55:00 PDT 2020


qiucf added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13156
+
   if (N0CFP && N0CFP->isExactlyValue(1.0))
+    return DAG.getNode(ISD::FADD, SDLoc(N), VT, N1, N2, Flags);
----------------
nemanjai wrote:
> A couple of things are unclear to me (although not related to this patch):
> 1. Why do we handle the `0.0` and `1.0` special cases before canonicalization and thereby have to check both ways?
> 2. Why is the handling for `-1.0` not in the same place?
The canonicalization code was added years after original folding logic. I guess it's just missed carelessly. We can have an NFC patch later refactoring it.


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

https://reviews.llvm.org/D87037



More information about the llvm-commits mailing list