From 5e742a3e1b29104fcadc26286f6daa6c450f87d9 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Thu, 11 Aug 2011 16:41:21 +0000 Subject: [AVX] If the data which is going to be saved is already in two XMM registers (for example, after integer operation), do not pack the registers into a YMM before saving. Its better to save as two XMM registers. Before: vinsertf128 $1, %xmm3, %ymm0, %ymm3 vinsertf128 $0, %xmm1, %ymm3, %ymm1 vmovaps %ymm1, 416(%rsp) After: vmovaps %xmm3, 416+16(%rsp) vmovaps %xmm1, 416(%rsp) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137308 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/avx-insert.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/CodeGen/X86/avx-insert.ll (limited to 'test/CodeGen/X86') diff --git a/test/CodeGen/X86/avx-insert.ll b/test/CodeGen/X86/avx-insert.ll new file mode 100644 index 0000000..d9eae03 --- /dev/null +++ b/test/CodeGen/X86/avx-insert.ll @@ -0,0 +1,17 @@ +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s + +; It is faster to make two saves, if the data is already in XMM registers. For +; example, after making an integer operation. +define void @double_save(<4 x i32>* %Ap, <4 x i32>* %Bp, <8 x i32>* %P) nounwind ssp { +entry: + ; CHECK: movaps + ; CHECK: movaps + ; CHECK: movaps + ; CHECK: movaps + %A = load <4 x i32>* %Ap + %B = load <4 x i32>* %Bp + %Z = shufflevector <4 x i32>%A, <4 x i32>%B, <8 x i32> + store <8 x i32> %Z, <8 x i32>* %P, align 16 + ret void +} + -- cgit v1.1