[llvm] r283042 - [CostModel][X86] Added fabs costs
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 1 09:30:13 PDT 2016
Author: rksimon
Date: Sat Oct 1 11:30:13 2016
New Revision: 283042
URL: http://llvm.org/viewvc/llvm-project?rev=283042&view=rev
Log:
[CostModel][X86] Added fabs costs
Modified:
llvm/trunk/test/Analysis/CostModel/X86/arith-fp.ll
Modified: llvm/trunk/test/Analysis/CostModel/X86/arith-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/arith-fp.ll?rev=283042&r1=283041&r2=283042&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/arith-fp.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/arith-fp.ll Sat Oct 1 11:30:13 2016
@@ -338,6 +338,61 @@ define i32 @fsqrt(i32 %arg) {
ret i32 undef
}
+; CHECK-LABEL: 'fabs'
+define i32 @fabs(i32 %arg) {
+ ; SSE2: cost of 2 {{.*}} %F32 = call float @llvm.fabs.f32
+ ; SSE42: cost of 2 {{.*}} %F32 = call float @llvm.fabs.f32
+ ; AVX: cost of 2 {{.*}} %F32 = call float @llvm.fabs.f32
+ ; AVX2: cost of 2 {{.*}} %F32 = call float @llvm.fabs.f32
+ ; AVX512: cost of 2 {{.*}} %F32 = call float @llvm.fabs.f32
+ %F32 = call float @llvm.fabs.f32(float undef)
+ ; SSE2: cost of 2 {{.*}} %V4F32 = call <4 x float> @llvm.fabs.v4f32
+ ; SSE42: cost of 2 {{.*}} %V4F32 = call <4 x float> @llvm.fabs.v4f32
+ ; AVX: cost of 2 {{.*}} %V4F32 = call <4 x float> @llvm.fabs.v4f32
+ ; AVX2: cost of 2 {{.*}} %V4F32 = call <4 x float> @llvm.fabs.v4f32
+ ; AVX512: cost of 2 {{.*}} %V4F32 = call <4 x float> @llvm.fabs.v4f32
+ %V4F32 = call <4 x float> @llvm.fabs.v4f32(<4 x float> undef)
+ ; SSE2: cost of 4 {{.*}} %V8F32 = call <8 x float> @llvm.fabs.v8f32
+ ; SSE42: cost of 4 {{.*}} %V8F32 = call <8 x float> @llvm.fabs.v8f32
+ ; AVX: cost of 2 {{.*}} %V8F32 = call <8 x float> @llvm.fabs.v8f32
+ ; AVX2: cost of 2 {{.*}} %V8F32 = call <8 x float> @llvm.fabs.v8f32
+ ; AVX512: cost of 2 {{.*}} %V8F32 = call <8 x float> @llvm.fabs.v8f32
+ %V8F32 = call <8 x float> @llvm.fabs.v8f32(<8 x float> undef)
+ ; SSE2: cost of 8 {{.*}} %V16F32 = call <16 x float> @llvm.fabs.v16f32
+ ; SSE42: cost of 8 {{.*}} %V16F32 = call <16 x float> @llvm.fabs.v16f32
+ ; AVX: cost of 4 {{.*}} %V16F32 = call <16 x float> @llvm.fabs.v16f32
+ ; AVX2: cost of 4 {{.*}} %V16F32 = call <16 x float> @llvm.fabs.v16f32
+ ; AVX512: cost of 2 {{.*}} %V16F32 = call <16 x float> @llvm.fabs.v16f32
+ %V16F32 = call <16 x float> @llvm.fabs.v16f32(<16 x float> undef)
+
+ ; SSE2: cost of 2 {{.*}} %F64 = call double @llvm.fabs.f64
+ ; SSE42: cost of 2 {{.*}} %F64 = call double @llvm.fabs.f64
+ ; AVX: cost of 2 {{.*}} %F64 = call double @llvm.fabs.f64
+ ; AVX2: cost of 2 {{.*}} %F64 = call double @llvm.fabs.f64
+ ; AVX512: cost of 2 {{.*}} %F64 = call double @llvm.fabs.f64
+ %F64 = call double @llvm.fabs.f64(double undef)
+ ; SSE2: cost of 2 {{.*}} %V2F64 = call <2 x double> @llvm.fabs.v2f64
+ ; SSE42: cost of 2 {{.*}} %V2F64 = call <2 x double> @llvm.fabs.v2f64
+ ; AVX: cost of 2 {{.*}} %V2F64 = call <2 x double> @llvm.fabs.v2f64
+ ; AVX2: cost of 2 {{.*}} %V2F64 = call <2 x double> @llvm.fabs.v2f64
+ ; AVX512: cost of 2 {{.*}} %V2F64 = call <2 x double> @llvm.fabs.v2f64
+ %V2F64 = call <2 x double> @llvm.fabs.v2f64(<2 x double> undef)
+ ; SSE2: cost of 4 {{.*}} %V4F64 = call <4 x double> @llvm.fabs.v4f64
+ ; SSE42: cost of 4 {{.*}} %V4F64 = call <4 x double> @llvm.fabs.v4f64
+ ; AVX: cost of 2 {{.*}} %V4F64 = call <4 x double> @llvm.fabs.v4f64
+ ; AVX2: cost of 2 {{.*}} %V4F64 = call <4 x double> @llvm.fabs.v4f64
+ ; AVX512: cost of 2 {{.*}} %V4F64 = call <4 x double> @llvm.fabs.v4f64
+ %V4F64 = call <4 x double> @llvm.fabs.v4f64(<4 x double> undef)
+ ; SSE2: cost of 8 {{.*}} %V8F64 = call <8 x double> @llvm.fabs.v8f64
+ ; SSE42: cost of 8 {{.*}} %V8F64 = call <8 x double> @llvm.fabs.v8f64
+ ; AVX: cost of 4 {{.*}} %V8F64 = call <8 x double> @llvm.fabs.v8f64
+ ; AVX2: cost of 4 {{.*}} %V8F64 = call <8 x double> @llvm.fabs.v8f64
+ ; AVX512: cost of 2 {{.*}} %V8F64 = call <8 x double> @llvm.fabs.v8f64
+ %V8F64 = call <8 x double> @llvm.fabs.v8f64(<8 x double> undef)
+
+ ret i32 undef
+}
+
; CHECK-LABEL: 'fma'
define i32 @fma(i32 %arg) {
; SSE2: cost of 10 {{.*}} %F32 = call float @llvm.fma.f32
@@ -403,6 +458,16 @@ declare <2 x double> @llvm.sqrt.v2f64(<2
declare <4 x double> @llvm.sqrt.v4f64(<4 x double>)
declare <8 x double> @llvm.sqrt.v8f64(<8 x double>)
+declare float @llvm.fabs.f32(float)
+declare <4 x float> @llvm.fabs.v4f32(<4 x float>)
+declare <8 x float> @llvm.fabs.v8f32(<8 x float>)
+declare <16 x float> @llvm.fabs.v16f32(<16 x float>)
+
+declare double @llvm.fabs.f64(double)
+declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
+declare <4 x double> @llvm.fabs.v4f64(<4 x double>)
+declare <8 x double> @llvm.fabs.v8f64(<8 x double>)
+
declare float @llvm.fma.f32(float, float, float)
declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)
declare <8 x float> @llvm.fma.v8f32(<8 x float>, <8 x float>, <8 x float>)
More information about the llvm-commits
mailing list