[DAGCombiner] Improve division estimation of floating points.
authorQiu Chaofan <qiucofan@cn.ibm.com>
Thu, 12 Sep 2019 07:51:24 +0000 (07:51 +0000)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Thu, 12 Sep 2019 07:51:24 +0000 (07:51 +0000)
commitb7fb5d0f6f2abf07f0ce6edc3397b4c291c1d25e
treeb5fb0cbe9b96f54540d31e4c268e1cf633b249d2
parent75f65fe8d316407c5dd7cd9bfdfc760203947aa1
[DAGCombiner] Improve division estimation of floating points.

Current implementation of estimating divisions loses precision since it
estimates reciprocal first and does multiplication.  This patch is to re-order
arithmetic operations in the last iteration in DAGCombiner to improve the
accuracy.

Reviewed By: Sanjay Patel, Jinsong Ji

Differential Revision: https://reviews.llvm.org/D66050

llvm-svn: 371713
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/fdiv.ll
llvm/test/CodeGen/AMDGPU/rsq.ll
llvm/test/CodeGen/PowerPC/qpx-recipest.ll
llvm/test/CodeGen/PowerPC/recipest.ll
llvm/test/CodeGen/X86/recip-fastmath.ll
llvm/test/CodeGen/X86/recip-fastmath2.ll