[llvm] 64186e9 - [X86] Add test showing failure to expand <2 x float> fpow without widening to <4 x float>
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 02:58:26 PDT 2022
Author: Simon Pilgrim
Date: 2022-05-24T10:45:20+01:00
New Revision: 64186e9b351a000123f253557f4f607c33405413
URL: https://github.com/llvm/llvm-project/commit/64186e9b351a000123f253557f4f607c33405413
DIFF: https://github.com/llvm/llvm-project/commit/64186e9b351a000123f253557f4f607c33405413.diff
LOG: [X86] Add test showing failure to expand <2 x float> fpow without widening to <4 x float>
Similar to D125988 (and I have a pending follow up patch to handle fpow).
Added:
llvm/test/CodeGen/X86/pow-libcall.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/pow-libcall.ll b/llvm/test/CodeGen/X86/pow-libcall.ll
new file mode 100644
index 0000000000000..e90155e5978cf
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pow-libcall.ll
@@ -0,0 +1,53 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64-linux-gnu < %s | FileCheck %s
+
+; FIXME: Ensure vectorized FPOWs are not widened/unrolled such that they get lowered
+; into libcalls on undef elements.
+
+define float @test_fpow_v2f32_multiuse(<2 x float> %a0, <2 x float> %a1, <2 x float> *%p3) nounwind {
+; CHECK-LABEL: test_fpow_v2f32_multiuse:
+; CHECK: # %bb.0:
+; CHECK-NEXT: pushq %rbx
+; CHECK-NEXT: subq $64, %rsp
+; CHECK-NEXT: movq %rdi, %rbx
+; CHECK-NEXT: movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; CHECK-NEXT: movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; CHECK-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,3,3,3]
+; CHECK-NEXT: shufps {{.*#+}} xmm1 = xmm1[3,3,3,3]
+; CHECK-NEXT: callq powf at PLT
+; CHECK-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload
+; CHECK-NEXT: movhlps {{.*#+}} xmm0 = xmm0[1,1]
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; CHECK-NEXT: movhlps {{.*#+}} xmm1 = xmm1[1,1]
+; CHECK-NEXT: callq powf at PLT
+; CHECK-NEXT: unpcklps (%rsp), %xmm0 # 16-byte Folded Reload
+; CHECK-NEXT: # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
+; CHECK-NEXT: movaps %xmm0, (%rsp) # 16-byte Spill
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; CHECK-NEXT: callq powf at PLT
+; CHECK-NEXT: movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload
+; CHECK-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,1,1]
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; CHECK-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,1,1]
+; CHECK-NEXT: callq powf at PLT
+; CHECK-NEXT: movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload
+; CHECK-NEXT: unpcklps {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
+; CHECK-NEXT: unpcklpd (%rsp), %xmm1 # 16-byte Folded Reload
+; CHECK-NEXT: # xmm1 = xmm1[0],mem[0]
+; CHECK-NEXT: addss %xmm1, %xmm0
+; CHECK-NEXT: movlps %xmm1, (%rbx)
+; CHECK-NEXT: addq $64, %rsp
+; CHECK-NEXT: popq %rbx
+; CHECK-NEXT: retq
+ %fp = call <2 x float> @llvm.pow.v2f32(<2 x float> %a0, <2 x float> %a1)
+ %fp0 = extractelement <2 x float> %fp, i32 0
+ %fp1 = extractelement <2 x float> %fp, i32 1
+ %res = fadd float %fp0, %fp1
+ store <2 x float> %fp, <2 x float> *%p3
+ ret float %res
+}
+declare <2 x float> @llvm.pow.v2f32(<2 x float>, <2 x float>)
+
More information about the llvm-commits
mailing list