diff options
| author | Qiu Chaofan <qiucofan@cn.ibm.com> | 2019-09-12 07:51:24 +0000 |
|---|---|---|
| committer | Qiu Chaofan <qiucofan@cn.ibm.com> | 2019-09-12 07:51:24 +0000 |
| commit | b7fb5d0f6f2abf07f0ce6edc3397b4c291c1d25e (patch) | |
| tree | b5fb0cbe9b96f54540d31e4c268e1cf633b249d2 /llvm/test/CodeGen/PowerPC/recipest.ll | |
| parent | 75f65fe8d316407c5dd7cd9bfdfc760203947aa1 (diff) | |
| download | bcm5719-llvm-b7fb5d0f6f2abf07f0ce6edc3397b4c291c1d25e.tar.gz bcm5719-llvm-b7fb5d0f6f2abf07f0ce6edc3397b4c291c1d25e.zip | |
[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
Diffstat (limited to 'llvm/test/CodeGen/PowerPC/recipest.ll')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/recipest.ll | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/test/CodeGen/PowerPC/recipest.ll b/llvm/test/CodeGen/PowerPC/recipest.ll index d1bf1c9e502..bc33617662e 100644 --- a/llvm/test/CodeGen/PowerPC/recipest.ll +++ b/llvm/test/CodeGen/PowerPC/recipest.ll @@ -145,13 +145,13 @@ define float @no_estimate_refinement_f32(float %a, float %b) #0 { define float @rsqrt_fmul_fmf(float %a, float %b, float %c) { ; CHECK: @rsqrt_fmul_fmf ; CHECK-DAG: frsqrtes -; CHECK-DAG: fres -; CHECK-DAG: fnmsubs -; CHECK-DAG: fmuls -; CHECK-DAG: fmadds -; CHECK-DAG: fmadds ; CHECK: fmuls +; CHECK-NEXT: fmadds ; CHECK-NEXT: fmuls +; CHECK-DAG: fres +; CHECK-COUNT-3: fmuls +; CHECK-NEXT: fmsubs +; CHECK-NEXT: fmadds ; CHECK-NEXT: fmuls ; CHECK-NEXT: blr %x = call fast float @llvm.sqrt.f32(float %a) @@ -196,9 +196,9 @@ define double @foo2_fmf(double %a, double %b) nounwind { ; CHECK-DAG: fre ; CHECK-DAG: fnmsub ; CHECK: fmadd +; CHECK-NEXT: fmul ; CHECK-NEXT: fnmsub ; CHECK-NEXT: fmadd -; CHECK-NEXT: fmul ; CHECK-NEXT: blr %r = fdiv fast double %a, %b ret double %r @@ -215,9 +215,9 @@ define double @foo2_safe(double %a, double %b) nounwind { define float @goo2_fmf(float %a, float %b) nounwind { ; CHECK: @goo2_fmf ; CHECK-DAG: fres +; CHECK-NEXT: fmuls ; CHECK-DAG: fnmsubs ; CHECK: fmadds -; CHECK-NEXT: fmuls ; CHECK-NEXT: blr %r = fdiv fast float %a, %b ret float %r |

