[llvm] 11e0c5b - [AArch64] add another test for reciprocal sqrt; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 06:41:25 PDT 2020
Author: Sanjay Patel
Date: 2020-08-31T09:35:59-04:00
New Revision: 11e0c5b648460256176f2348d724338218542dce
URL: https://github.com/llvm/llvm-project/commit/11e0c5b648460256176f2348d724338218542dce
DIFF: https://github.com/llvm/llvm-project/commit/11e0c5b648460256176f2348d724338218542dce.diff
LOG: [AArch64] add another test for reciprocal sqrt; NFC
Added:
Modified:
llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll b/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
index ccc100e2b86f..85886938a186 100644
--- a/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
+++ b/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
@@ -567,6 +567,57 @@ define double @sqrt_simplify_before_recip_3_uses(double %x, double* %p1, double*
ret double %sqrt_fast
}
+define double @sqrt_simplify_before_recip_3_uses_order(double %x, double* %p1, double* %p2) nounwind {
+; FAULT-LABEL: sqrt_simplify_before_recip_3_uses_order:
+; FAULT: // %bb.0:
+; FAULT-NEXT: mov x8, #4631107791820423168
+; FAULT-NEXT: fmov d3, x8
+; FAULT-NEXT: mov x8, #140737488355328
+; FAULT-NEXT: fsqrt d1, d0
+; FAULT-NEXT: fmov d2, #1.00000000
+; FAULT-NEXT: movk x8, #16453, lsl #48
+; FAULT-NEXT: fdiv d1, d2, d1
+; FAULT-NEXT: fmov d2, x8
+; FAULT-NEXT: fmul d0, d0, d1
+; FAULT-NEXT: fmul d3, d1, d3
+; FAULT-NEXT: fmul d1, d1, d2
+; FAULT-NEXT: str d3, [x0]
+; FAULT-NEXT: str d1, [x1]
+; FAULT-NEXT: ret
+;
+; CHECK-LABEL: sqrt_simplify_before_recip_3_uses_order:
+; CHECK: // %bb.0:
+; CHECK-NEXT: frsqrte d1, d0
+; CHECK-NEXT: fmul d3, d1, d1
+; CHECK-NEXT: frsqrts d3, d0, d3
+; CHECK-NEXT: fmul d1, d1, d3
+; CHECK-NEXT: fmul d3, d1, d1
+; CHECK-NEXT: frsqrts d3, d0, d3
+; CHECK-NEXT: mov x8, #4631107791820423168
+; CHECK-NEXT: fmul d1, d1, d3
+; CHECK-NEXT: fmov d2, x8
+; CHECK-NEXT: mov x8, #140737488355328
+; CHECK-NEXT: fmul d3, d1, d1
+; CHECK-NEXT: movk x8, #16453, lsl #48
+; CHECK-NEXT: frsqrts d3, d0, d3
+; CHECK-NEXT: fmul d1, d1, d3
+; CHECK-NEXT: fmov d3, x8
+; CHECK-NEXT: fmul d0, d0, d1
+; CHECK-NEXT: fmul d2, d1, d2
+; CHECK-NEXT: fmul d1, d1, d3
+; CHECK-NEXT: str d2, [x0]
+; CHECK-NEXT: str d1, [x1]
+; CHECK-NEXT: ret
+ %sqrt = tail call fast double @llvm.sqrt.f64(double %x)
+ %sqrt_fast = fdiv fast double %x, %sqrt
+ %r1 = fdiv fast double 42.0, %sqrt
+ %r2 = fdiv fast double 43.0, %sqrt
+ store double %r1, double* %p1, align 8
+ store double %r2, double* %p2, align 8
+ ret double %sqrt_fast
+}
+
+
define double @sqrt_simplify_before_recip_4_uses(double %x, double* %p1, double* %p2, double* %p3) nounwind {
; FAULT-LABEL: sqrt_simplify_before_recip_4_uses:
; FAULT: // %bb.0:
More information about the llvm-commits
mailing list