[llvm] r283044 - [CostModel][X86] Added fcopysign costs

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 1 10:04:51 PDT 2016


----- Original Message -----
> From: "Simon Pilgrim via llvm-commits" <llvm-commits at lists.llvm.org>
> To: llvm-commits at lists.llvm.org
> Sent: Saturday, October 1, 2016 11:41:52 AM
> Subject: [llvm] r283044 - [CostModel][X86] Added fcopysign costs
> 
> Author: rksimon
> Date: Sat Oct  1 11:41:52 2016
> New Revision: 283044
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=283044&view=rev
> Log:
> [CostModel][X86] Added fcopysign costs

This commit message makes this sound like a functionality change, but you're only adding regressions tests for existing functionality. Tests are certainly good, but please make the commit messages more clear.

Thanks again,
Hal

> 
> 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=283044&r1=283043&r2=283044&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:41:52 2016
> @@ -393,6 +393,61 @@ define i32 @fabs(i32 %arg) {
>    ret i32 undef
>  }
>  
> +; CHECK-LABEL: 'fcopysign'
> +define i32 @fcopysign(i32 %arg) {
> +  ; SSE2: cost of 2 {{.*}} %F32 = call float @llvm.copysign.f32
> +  ; SSE42: cost of 2 {{.*}} %F32 = call float @llvm.copysign.f32
> +  ; AVX: cost of 2 {{.*}} %F32 = call float @llvm.copysign.f32
> +  ; AVX2: cost of 2 {{.*}} %F32 = call float @llvm.copysign.f32
> +  ; AVX512: cost of 2 {{.*}} %F32 = call float @llvm.copysign.f32
> +  %F32 = call float @llvm.copysign.f32(float undef, float undef)
> +  ; SSE2: cost of 17 {{.*}} %V4F32 = call <4 x float>
> @llvm.copysign.v4f32
> +  ; SSE42: cost of 17 {{.*}} %V4F32 = call <4 x float>
> @llvm.copysign.v4f32
> +  ; AVX: cost of 17 {{.*}} %V4F32 = call <4 x float>
> @llvm.copysign.v4f32
> +  ; AVX2: cost of 17 {{.*}} %V4F32 = call <4 x float>
> @llvm.copysign.v4f32
> +  ; AVX512: cost of 17 {{.*}} %V4F32 = call <4 x float>
> @llvm.copysign.v4f32
> +  %V4F32 = call <4 x float> @llvm.copysign.v4f32(<4 x float> undef,
> <4 x float> undef)
> +  ; SSE2: cost of 34 {{.*}} %V8F32 = call <8 x float>
> @llvm.copysign.v8f32
> +  ; SSE42: cost of 34 {{.*}} %V8F32 = call <8 x float>
> @llvm.copysign.v8f32
> +  ; AVX: cost of 37 {{.*}} %V8F32 = call <8 x float>
> @llvm.copysign.v8f32
> +  ; AVX2: cost of 37 {{.*}} %V8F32 = call <8 x float>
> @llvm.copysign.v8f32
> +  ; AVX512: cost of 37 {{.*}} %V8F32 = call <8 x float>
> @llvm.copysign.v8f32
> +  %V8F32 = call <8 x float> @llvm.copysign.v8f32(<8 x float> undef,
> <8 x float> undef)
> +  ; SSE2: cost of 68 {{.*}} %V16F32 = call <16 x float>
> @llvm.copysign.v16f32
> +  ; SSE42: cost of 68 {{.*}} %V16F32 = call <16 x float>
> @llvm.copysign.v16f32
> +  ; AVX: cost of 74 {{.*}} %V16F32 = call <16 x float>
> @llvm.copysign.v16f32
> +  ; AVX2: cost of 74 {{.*}} %V16F32 = call <16 x float>
> @llvm.copysign.v16f32
> +  ; AVX512: cost of 77 {{.*}} %V16F32 = call <16 x float>
> @llvm.copysign.v16f32
> +  %V16F32 = call <16 x float> @llvm.copysign.v16f32(<16 x float>
> undef, <16 x float> undef)
> +
> +  ; SSE2: cost of 2 {{.*}} %F64 = call double @llvm.copysign.f64
> +  ; SSE42: cost of 2 {{.*}} %F64 = call double @llvm.copysign.f64
> +  ; AVX: cost of 2 {{.*}} %F64 = call double @llvm.copysign.f64
> +  ; AVX2: cost of 2 {{.*}} %F64 = call double @llvm.copysign.f64
> +  ; AVX512: cost of 2 {{.*}} %F64 = call double @llvm.copysign.f64
> +  %F64 = call double @llvm.copysign.f64(double undef, double undef)
> +  ; SSE2: cost of 7 {{.*}} %V2F64 = call <2 x double>
> @llvm.copysign.v2f64
> +  ; SSE42: cost of 7 {{.*}} %V2F64 = call <2 x double>
> @llvm.copysign.v2f64
> +  ; AVX: cost of 7 {{.*}} %V2F64 = call <2 x double>
> @llvm.copysign.v2f64
> +  ; AVX2: cost of 7 {{.*}} %V2F64 = call <2 x double>
> @llvm.copysign.v2f64
> +  ; AVX512: cost of 7 {{.*}} %V2F64 = call <2 x double>
> @llvm.copysign.v2f64
> +  %V2F64 = call <2 x double> @llvm.copysign.v2f64(<2 x double>
> undef, <2 x double> undef)
> +  ; SSE2: cost of 14 {{.*}} %V4F64 = call <4 x double>
> @llvm.copysign.v4f64
> +  ; SSE42: cost of 14 {{.*}} %V4F64 = call <4 x double>
> @llvm.copysign.v4f64
> +  ; AVX: cost of 17 {{.*}} %V4F64 = call <4 x double>
> @llvm.copysign.v4f64
> +  ; AVX2: cost of 17 {{.*}} %V4F64 = call <4 x double>
> @llvm.copysign.v4f64
> +  ; AVX512: cost of 17 {{.*}} %V4F64 = call <4 x double>
> @llvm.copysign.v4f64
> +  %V4F64 = call <4 x double> @llvm.copysign.v4f64(<4 x double>
> undef, <4 x double> undef)
> +  ; SSE2: cost of 28 {{.*}} %V8F64 = call <8 x double>
> @llvm.copysign.v8f64
> +  ; SSE42: cost of 28 {{.*}} %V8F64 = call <8 x double>
> @llvm.copysign.v8f64
> +  ; AVX: cost of 34 {{.*}} %V8F64 = call <8 x double>
> @llvm.copysign.v8f64
> +  ; AVX2: cost of 34 {{.*}} %V8F64 = call <8 x double>
> @llvm.copysign.v8f64
> +  ; AVX512: cost of 37 {{.*}} %V8F64 = call <8 x double>
> @llvm.copysign.v8f64
> +  %V8F64 = call <8 x double> @llvm.copysign.v8f64(<8 x double>
> undef, <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
> @@ -468,6 +523,16 @@ declare <2 x double> @llvm.fabs.v2f64(<2
>  declare <4 x double> @llvm.fabs.v4f64(<4 x double>)
>  declare <8 x double> @llvm.fabs.v8f64(<8 x double>)
>  
> +declare float @llvm.copysign.f32(float, float)
> +declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>)
> +declare <8 x float> @llvm.copysign.v8f32(<8 x float>, <8 x float>)
> +declare <16 x float> @llvm.copysign.v16f32(<16 x float>, <16 x
> float>)
> +
> +declare double @llvm.copysign.f64(double, double)
> +declare <2 x double> @llvm.copysign.v2f64(<2 x double>, <2 x
> double>)
> +declare <4 x double> @llvm.copysign.v4f64(<4 x double>, <4 x
> double>)
> +declare <8 x double> @llvm.copysign.v8f64(<8 x double>, <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>)
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list