[PATCH] D76853: [DAGCombiner] Use rsqrt to estimate sqrt only when ninf flag set

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 08:39:01 PDT 2020


qiucf created this revision.
qiucf added reviewers: PowerPC, hfinkel, jsji, nemanjai, spatel, evandro, craig.scott, jlebar.
Herald added subscribers: llvm-commits, hiraditya, jholewinski.
Herald added a project: LLVM.

Currently we use `rsqrt` to build estimation of `sqrt`. But this would produce wrong result (`NaN`) when x is +infinity.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76853

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/NVPTX/fast-math.ll
  llvm/test/CodeGen/NVPTX/sqrt-approx.ll
  llvm/test/CodeGen/PowerPC/fmf-propagation.ll
  llvm/test/CodeGen/X86/sqrt-fastmath-mir.ll
  llvm/test/CodeGen/X86/sqrt-fastmath.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76853.252855.patch
Type: text/x-patch
Size: 28333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200326/19c2383d/attachment.bin>


More information about the llvm-commits mailing list