[llvm] r335367 - [X86] Add a test to show missed opportunity to generate vfnmadd
Easwaran Raman via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 22 10:01:13 PDT 2018
Author: eraman
Date: Fri Jun 22 10:01:13 2018
New Revision: 335367
URL: http://llvm.org/viewvc/llvm-project?rev=335367&view=rev
Log:
[X86] Add a test to show missed opportunity to generate vfnmadd
Modified:
llvm/trunk/test/CodeGen/X86/avx2-fma-fneg-combine.ll
Modified: llvm/trunk/test/CodeGen/X86/avx2-fma-fneg-combine.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx2-fma-fneg-combine.ll?rev=335367&r1=335366&r2=335367&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/avx2-fma-fneg-combine.ll (original)
+++ llvm/trunk/test/CodeGen/X86/avx2-fma-fneg-combine.ll Fri Jun 22 10:01:13 2018
@@ -115,3 +115,31 @@ entry:
declare <2 x double> @llvm.x86.fma.vfmadd.pd(<2 x double> %a, <2 x double> %b, <2 x double> %c)
+define <8 x float> @test7(float %a, <8 x float> %b, <8 x float> %c) {
+; X32-LABEL: test7:
+; X32: # %bb.0: # %entry
+; X32-NEXT: vmovss {{.*#+}} xmm2 = mem[0],zero,zero,zero
+; X32-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; X32-NEXT: vsubps %ymm2, %ymm3, %ymm2
+; X32-NEXT: vbroadcastss %xmm2, %ymm2
+; X32-NEXT: vfmadd213ps {{.*#+}} ymm0 = (ymm2 * ymm0) + ymm1
+; X32-NEXT: retl
+;
+; X64-LABEL: test7:
+; X64: # %bb.0: # %entry
+; X64-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
+; X64-NEXT: vmovss {{.*#+}} xmm3 = mem[0],zero,zero,zero
+; X64-NEXT: vsubps %ymm0, %ymm3, %ymm0
+; X64-NEXT: vbroadcastss %xmm0, %ymm0
+; X64-NEXT: vfmadd213ps {{.*#+}} ymm0 = (ymm1 * ymm0) + ymm2
+; X64-NEXT: retq
+entry:
+ %0 = insertelement <8 x float> undef, float %a, i32 0
+ %1 = fsub <8 x float> <float -0.000000e+00, float undef, float undef, float undef, float undef, float undef, float undef, float undef>, %0
+ %2 = shufflevector <8 x float> %1, <8 x float> undef, <8 x i32> zeroinitializer
+ %3 = tail call <8 x float> @llvm.fma.v8f32(<8 x float> %2, <8 x float> %b, <8 x float> %c)
+ ret <8 x float> %3
+
+}
+
+declare <8 x float> @llvm.fma.v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %c)
More information about the llvm-commits
mailing list