1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[PowerPC] Removing sqrtd2 and sqrtf4 from list of vectorizable function with MASSV

Under -O3 and -Ofast, the MASSV conversion prevents the sqrt call to be inlined.
Inline sqrt is faster than MASSV call on leppc.

Differential Revision: https://reviews.llvm.org/D97487
This commit is contained in:
Masoud Ataei 2021-03-01 15:42:19 +00:00
parent 918dfd8b20
commit eeb7eb5db7
3 changed files with 2 additions and 32 deletions

View File

@ -156,10 +156,6 @@ TLI_DEFINE_VECFUNC("pow", "__powd2_massv", FIXED(2))
TLI_DEFINE_VECFUNC("llvm.pow.f64", "__powd2_massv", FIXED(2))
TLI_DEFINE_VECFUNC("powf", "__powf4_massv", FIXED(4))
TLI_DEFINE_VECFUNC("llvm.pow.f32", "__powf4_massv", FIXED(4))
TLI_DEFINE_VECFUNC("sqrt", "__sqrtd2_massv", FIXED(2))
TLI_DEFINE_VECFUNC("llvm.sqrt.f64", "__sqrtd2_massv", FIXED(2))
TLI_DEFINE_VECFUNC("sqrtf", "__sqrtf4_massv", FIXED(4))
TLI_DEFINE_VECFUNC("llvm.sqrt.f32", "__sqrtf4_massv", FIXED(4))
// Exponential and Logarithmic Functions
TLI_DEFINE_VECFUNC("exp", "__expd2_massv", FIXED(2))

View File

@ -8,9 +8,6 @@ declare <4 x float> @__cbrtf4_massv(<4 x float>)
declare <2 x double> @__powd2_massv(<2 x double>, <2 x double>)
declare <4 x float> @__powf4_massv(<4 x float>, <4 x float>)
declare <2 x double> @__sqrtd2_massv(<2 x double>)
declare <4 x float> @__sqrtf4_massv(<4 x float>)
declare <2 x double> @__expd2_massv(<2 x double>)
declare <4 x float> @__expf4_massv(<4 x float>)
@ -118,29 +115,6 @@ define <4 x float> @pow_f32_massv(<4 x float> %opnd1, <4 x float> %opnd2) {
ret <4 x float> %1
}
; sqrt
define <2 x double> @sqrt_f64_massv(<2 x double> %opnd) {
; CHECK-ALL-LABEL: @sqrt_f64_massv
; CHECK-PWR9: bl __sqrtd2_P9
; CHECK-PWR8: bl __sqrtd2_P8
; CHECK-NOT: bl __sqrtd2_massv
; CHECK-ALL: blr
;
%1 = call <2 x double> @__sqrtd2_massv(<2 x double> %opnd)
ret <2 x double> %1
}
define <4 x float> @sqrt_f32_massv(<4 x float> %opnd) {
; CHECK-ALL-LABEL: @sqrt_f32_massv
; CHECK-PWR9: bl __sqrtf4_P9
; CHECK-PWR8: bl __sqrtf4_P8
; CHECK-NOT: bl __sqrtf4_massv
; CHECK-ALL: blr
;
%1 = call <4 x float> @__sqrtf4_massv(<4 x float> %opnd)
ret <4 x float> %1
}
; exp
define <2 x double> @exp_f64_massv(<2 x double> %opnd) {
; CHECK-ALL-LABEL: @exp_f64_massv

View File

@ -236,7 +236,7 @@ for.end:
define void @sqrt_f64(double* nocapture %varray) {
; CHECK-LABEL: @sqrt_f64(
; CHECK: __sqrtd2_massv{{.*}}<2 x double>
; CHECK-NOT: __sqrtd2_massv{{.*}}<2 x double>
; CHECK: ret void
;
entry:
@ -259,7 +259,7 @@ for.end:
define void @sqrt_f32(float* nocapture %varray) {
; CHECK-LABEL: @sqrt_f32(
; CHECK: __sqrtf4_massv{{.*}}<4 x float>
; CHECK-NOT: __sqrtf4_massv{{.*}}<4 x float>
; CHECK: ret void
;
entry: