[PATCH] D80974: [DAGCombine] Adding a hook to improve the precision of fsqrt if the input is denormal

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 06:33:16 PDT 2020


spatel added a comment.

Not sure about other targets, but x86 is mostly expected to flush denorms (FTZ/DAZ) when using fast-math, so this should not matter even if we decide to override the default setting.



================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:4213
+                                              SelectionDAG &DAG) const {
+    return SDValue();
+  }
----------------
Can we have this default to:
  return DAG.getConstantFP(0.0, SDLoc(Operand), Operand.getValueType());
and save some code in the calling function?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:21403
+        // The estimate is now completely wrong if the input was exactly 0.0 or
+        // possibly a denormal. Force the answer to 0.0 or value that provided
+        // by target for those cases.
----------------
"value that provided" -> "value provided"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80974





More information about the llvm-commits mailing list