[llvm] d48699e - [InstCombine] adjust recip sqrt tests for better coverage; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 1 06:43:55 PDT 2020
Author: Sanjay Patel
Date: 2020-09-01T09:43:42-04:00
New Revision: d48699e3e89f342ecb9dfc288f6840cd41ecb5e5
URL: https://github.com/llvm/llvm-project/commit/d48699e3e89f342ecb9dfc288f6840cd41ecb5e5
DIFF: https://github.com/llvm/llvm-project/commit/d48699e3e89f342ecb9dfc288f6840cd41ecb5e5.diff
LOG: [InstCombine] adjust recip sqrt tests for better coverage; NFC
Goes with D86726
Added:
Modified:
llvm/test/Transforms/InstCombine/fmul-sqrt.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/fmul-sqrt.ll b/llvm/test/Transforms/InstCombine/fmul-sqrt.ll
index f2497d0a84be..de030bb59c56 100644
--- a/llvm/test/Transforms/InstCombine/fmul-sqrt.ll
+++ b/llvm/test/Transforms/InstCombine/fmul-sqrt.ll
@@ -101,34 +101,34 @@ define double @rsqrt_squared(double %x) {
define double @rsqrt_x_reassociate_extra_use(double %x, double * %p) {
; CHECK-LABEL: @rsqrt_x_reassociate_extra_use(
-; CHECK-NEXT: [[SQRT:%.*]] = call fast double @llvm.sqrt.f64(double [[X:%.*]])
-; CHECK-NEXT: [[RSQRT:%.*]] = fdiv fast double 1.000000e+00, [[SQRT]]
-; CHECK-NEXT: [[RES:%.*]] = fmul reassoc double [[RSQRT]], [[X:%.*]]
-; CHECK-NEXT: store double [[RSQRT]], double* %p
+; CHECK-NEXT: [[SQRT:%.*]] = call double @llvm.sqrt.f64(double [[X:%.*]])
+; CHECK-NEXT: [[RSQRT:%.*]] = fdiv double 1.000000e+00, [[SQRT]]
+; CHECK-NEXT: [[RES:%.*]] = fmul reassoc nsz double [[RSQRT]], [[X]]
+; CHECK-NEXT: store double [[RSQRT]], double* [[P:%.*]], align 8
; CHECK-NEXT: ret double [[RES]]
;
- %sqrt = call fast double @llvm.sqrt.f64(double %x)
- %rsqrt = fdiv fast double 1.0, %sqrt
- %res = fmul reassoc double %rsqrt, %x
+ %sqrt = call double @llvm.sqrt.f64(double %x)
+ %rsqrt = fdiv double 1.0, %sqrt
+ %res = fmul reassoc nsz double %rsqrt, %x
store double %rsqrt, double* %p
ret double %res
}
-define double @x_add_y_rsqrt_reassociate_extra_use(double %x, double %y, double * %p) {
+define <2 x float> @x_add_y_rsqrt_reassociate_extra_use(<2 x float> %x, <2 x float> %y, <2 x float>* %p) {
; CHECK-LABEL: @x_add_y_rsqrt_reassociate_extra_use(
-; CHECK-NEXT: [[ADD:%.*]] = fadd fast double %x, %y
-; CHECK-NEXT: [[SQRT:%.*]] = call fast double @llvm.sqrt.f64(double [[ADD]])
-; CHECK-NEXT: [[RSQRT:%.*]] = fdiv fast double 1.000000e+00, [[SQRT]]
-; CHECK-NEXT: [[RES:%.*]] = fmul reassoc double [[ADD]], [[RSQRT]]
-; CHECK-NEXT: store double [[RSQRT]], double* %p
-; CHECK-NEXT: ret double [[RES]]
+; CHECK-NEXT: [[ADD:%.*]] = fadd fast <2 x float> [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[SQRT:%.*]] = call fast <2 x float> @llvm.sqrt.v2f32(<2 x float> [[ADD]])
+; CHECK-NEXT: [[RSQRT:%.*]] = fdiv fast <2 x float> <float 1.000000e+00, float 1.000000e+00>, [[SQRT]]
+; CHECK-NEXT: [[RES:%.*]] = fmul fast <2 x float> [[ADD]], [[RSQRT]]
+; CHECK-NEXT: store <2 x float> [[RSQRT]], <2 x float>* [[P:%.*]], align 8
+; CHECK-NEXT: ret <2 x float> [[RES]]
;
- %add = fadd fast double %x, %y ; thwart complexity-based canonicalization
- %sqrt = call fast double @llvm.sqrt.f64(double %add)
- %rsqrt = fdiv fast double 1.0, %sqrt
- %res = fmul reassoc double %add, %rsqrt
- store double %rsqrt, double* %p
- ret double %res
+ %add = fadd fast <2 x float> %x, %y ; thwart complexity-based canonicalization
+ %sqrt = call fast <2 x float> @llvm.sqrt.v2f32(<2 x float> %add)
+ %rsqrt = fdiv fast <2 x float> <float 1.0, float 1.0>, %sqrt
+ %res = fmul fast <2 x float> %add, %rsqrt
+ store <2 x float> %rsqrt, <2 x float>* %p
+ ret <2 x float> %res
}
define double @sqrt_divisor_squared(double %x, double %y) {
More information about the llvm-commits
mailing list