2017-10-09 03:18:10 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-linux -mattr=+sse4.2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-SSE
|
|
|
|
; RUN: llc < %s -mtriple=i686-linux -mattr=+avx | FileCheck %s --check-prefix=X86 --check-prefix=X86-AVX --check-prefix=X86-AVX1
|
|
|
|
; RUN: llc < %s -mtriple=i686-linux -mattr=+avx2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-AVX --check-prefix=X86-AVX2
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse4.2 | FileCheck %s --check-prefix=X64 --check-prefix=X64-SSE
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux -mattr=+avx | FileCheck %s --check-prefix=X64 --check-prefix=X64-AVX --check-prefix=X64-AVX1
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux -mattr=+avx2 | FileCheck %s --check-prefix=X64 --check-prefix=X64-AVX --check-prefix=X64-AVX2
|
|
|
|
|
|
|
|
; PR27708
|
|
|
|
|
|
|
|
define <7 x i64> @load7_aligned(<7 x i64>* %x) {
|
|
|
|
; X86-SSE-LABEL: load7_aligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86-SSE: # %bb.0:
|
2017-10-09 03:18:10 +08:00
|
|
|
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X86-SSE-NEXT: movaps (%ecx), %xmm0
|
|
|
|
; X86-SSE-NEXT: movaps 16(%ecx), %xmm1
|
|
|
|
; X86-SSE-NEXT: movaps 32(%ecx), %xmm2
|
|
|
|
; X86-SSE-NEXT: movl 48(%ecx), %edx
|
|
|
|
; X86-SSE-NEXT: movl 52(%ecx), %ecx
|
|
|
|
; X86-SSE-NEXT: movl %ecx, 52(%eax)
|
|
|
|
; X86-SSE-NEXT: movl %edx, 48(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm2, 32(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm1, 16(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm0, (%eax)
|
|
|
|
; X86-SSE-NEXT: retl $4
|
|
|
|
;
|
2017-10-22 04:19:48 +08:00
|
|
|
; X86-AVX-LABEL: load7_aligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86-AVX: # %bb.0:
|
2017-10-22 04:19:48 +08:00
|
|
|
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X86-AVX-NEXT: vmovaps (%ecx), %ymm0
|
[x86] allow vector load narrowing with multi-use values
This is a long-awaited follow-up suggested in D33578. Since then, we've picked up even more
opportunities for vector narrowing from changes like D53784, so there are a lot of test diffs.
Apart from 2-3 strange cases, these are all wins.
I've structured this to be no-functional-change-intended for any target except for x86
because I couldn't tell if AArch64, ARM, and AMDGPU would improve or not. All of those
targets have existing regression tests (4, 4, 10 files respectively) that would be
affected. Also, Hexagon overrides the shouldReduceLoadWidth() hook, but doesn't show
any regression test diffs. The trade-off is deciding if an extra vector load is better
than a single wide load + extract_subvector.
For x86, this is almost always better (on paper at least) because we often can fold
loads into subsequent ops and not increase the official instruction count. There's also
some unknown -- but potentially large -- benefit from using narrower vector ops if wide
ops are implemented with multiple uops and/or frequency throttling is avoided.
Differential Revision: https://reviews.llvm.org/D54073
llvm-svn: 346595
2018-11-11 04:05:31 +08:00
|
|
|
; X86-AVX-NEXT: vmovaps 48(%ecx), %xmm1
|
|
|
|
; X86-AVX-NEXT: vextractps $1, %xmm1, 52(%eax)
|
|
|
|
; X86-AVX-NEXT: vmovss %xmm1, 48(%eax)
|
|
|
|
; X86-AVX-NEXT: vmovaps 32(%ecx), %xmm1
|
2017-10-22 04:19:48 +08:00
|
|
|
; X86-AVX-NEXT: vmovaps %xmm1, 32(%eax)
|
[x86] allow vector load narrowing with multi-use values
This is a long-awaited follow-up suggested in D33578. Since then, we've picked up even more
opportunities for vector narrowing from changes like D53784, so there are a lot of test diffs.
Apart from 2-3 strange cases, these are all wins.
I've structured this to be no-functional-change-intended for any target except for x86
because I couldn't tell if AArch64, ARM, and AMDGPU would improve or not. All of those
targets have existing regression tests (4, 4, 10 files respectively) that would be
affected. Also, Hexagon overrides the shouldReduceLoadWidth() hook, but doesn't show
any regression test diffs. The trade-off is deciding if an extra vector load is better
than a single wide load + extract_subvector.
For x86, this is almost always better (on paper at least) because we often can fold
loads into subsequent ops and not increase the official instruction count. There's also
some unknown -- but potentially large -- benefit from using narrower vector ops if wide
ops are implemented with multiple uops and/or frequency throttling is avoided.
Differential Revision: https://reviews.llvm.org/D54073
llvm-svn: 346595
2018-11-11 04:05:31 +08:00
|
|
|
; X86-AVX-NEXT: vmovaps %ymm0, (%eax)
|
2017-10-22 04:19:48 +08:00
|
|
|
; X86-AVX-NEXT: vzeroupper
|
|
|
|
; X86-AVX-NEXT: retl $4
|
2017-10-09 03:18:10 +08:00
|
|
|
;
|
|
|
|
; X64-SSE-LABEL: load7_aligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64-SSE: # %bb.0:
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-SSE-NEXT: movq %rdi, %rax
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-SSE-NEXT: movaps (%rsi), %xmm0
|
|
|
|
; X64-SSE-NEXT: movaps 16(%rsi), %xmm1
|
|
|
|
; X64-SSE-NEXT: movaps 32(%rsi), %xmm2
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-SSE-NEXT: movq 48(%rsi), %rcx
|
|
|
|
; X64-SSE-NEXT: movq %rcx, 48(%rdi)
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-SSE-NEXT: movaps %xmm2, 32(%rdi)
|
|
|
|
; X64-SSE-NEXT: movaps %xmm1, 16(%rdi)
|
|
|
|
; X64-SSE-NEXT: movaps %xmm0, (%rdi)
|
|
|
|
; X64-SSE-NEXT: retq
|
|
|
|
;
|
|
|
|
; X64-AVX-LABEL: load7_aligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64-AVX: # %bb.0:
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-AVX-NEXT: movq %rdi, %rax
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-AVX-NEXT: vmovaps (%rsi), %ymm0
|
[x86] allow vector load narrowing with multi-use values
This is a long-awaited follow-up suggested in D33578. Since then, we've picked up even more
opportunities for vector narrowing from changes like D53784, so there are a lot of test diffs.
Apart from 2-3 strange cases, these are all wins.
I've structured this to be no-functional-change-intended for any target except for x86
because I couldn't tell if AArch64, ARM, and AMDGPU would improve or not. All of those
targets have existing regression tests (4, 4, 10 files respectively) that would be
affected. Also, Hexagon overrides the shouldReduceLoadWidth() hook, but doesn't show
any regression test diffs. The trade-off is deciding if an extra vector load is better
than a single wide load + extract_subvector.
For x86, this is almost always better (on paper at least) because we often can fold
loads into subsequent ops and not increase the official instruction count. There's also
some unknown -- but potentially large -- benefit from using narrower vector ops if wide
ops are implemented with multiple uops and/or frequency throttling is avoided.
Differential Revision: https://reviews.llvm.org/D54073
llvm-svn: 346595
2018-11-11 04:05:31 +08:00
|
|
|
; X64-AVX-NEXT: movq 48(%rsi), %rcx
|
|
|
|
; X64-AVX-NEXT: movq %rcx, 48(%rdi)
|
|
|
|
; X64-AVX-NEXT: vmovaps 32(%rsi), %xmm1
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-AVX-NEXT: vmovaps %xmm1, 32(%rdi)
|
[x86] allow vector load narrowing with multi-use values
This is a long-awaited follow-up suggested in D33578. Since then, we've picked up even more
opportunities for vector narrowing from changes like D53784, so there are a lot of test diffs.
Apart from 2-3 strange cases, these are all wins.
I've structured this to be no-functional-change-intended for any target except for x86
because I couldn't tell if AArch64, ARM, and AMDGPU would improve or not. All of those
targets have existing regression tests (4, 4, 10 files respectively) that would be
affected. Also, Hexagon overrides the shouldReduceLoadWidth() hook, but doesn't show
any regression test diffs. The trade-off is deciding if an extra vector load is better
than a single wide load + extract_subvector.
For x86, this is almost always better (on paper at least) because we often can fold
loads into subsequent ops and not increase the official instruction count. There's also
some unknown -- but potentially large -- benefit from using narrower vector ops if wide
ops are implemented with multiple uops and/or frequency throttling is avoided.
Differential Revision: https://reviews.llvm.org/D54073
llvm-svn: 346595
2018-11-11 04:05:31 +08:00
|
|
|
; X64-AVX-NEXT: vmovaps %ymm0, (%rdi)
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-AVX-NEXT: vzeroupper
|
|
|
|
; X64-AVX-NEXT: retq
|
|
|
|
%x1 = load <7 x i64>, <7 x i64>* %x
|
|
|
|
ret <7 x i64> %x1
|
|
|
|
}
|
|
|
|
|
|
|
|
define <7 x i64> @load7_unaligned(<7 x i64>* %x) {
|
|
|
|
; X86-SSE-LABEL: load7_unaligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86-SSE: # %bb.0:
|
2017-10-09 03:18:10 +08:00
|
|
|
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X86-SSE-NEXT: movups (%ecx), %xmm0
|
|
|
|
; X86-SSE-NEXT: movups 16(%ecx), %xmm1
|
|
|
|
; X86-SSE-NEXT: movups 32(%ecx), %xmm2
|
|
|
|
; X86-SSE-NEXT: movl 48(%ecx), %edx
|
|
|
|
; X86-SSE-NEXT: movl 52(%ecx), %ecx
|
|
|
|
; X86-SSE-NEXT: movl %ecx, 52(%eax)
|
|
|
|
; X86-SSE-NEXT: movl %edx, 48(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm2, 32(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm1, 16(%eax)
|
|
|
|
; X86-SSE-NEXT: movaps %xmm0, (%eax)
|
|
|
|
; X86-SSE-NEXT: retl $4
|
|
|
|
;
|
|
|
|
; X86-AVX-LABEL: load7_unaligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X86-AVX: # %bb.0:
|
2017-10-09 03:18:10 +08:00
|
|
|
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; X86-AVX-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; X86-AVX-NEXT: vmovups (%ecx), %ymm0
|
|
|
|
; X86-AVX-NEXT: vmovups 32(%ecx), %xmm1
|
|
|
|
; X86-AVX-NEXT: movl 48(%ecx), %edx
|
|
|
|
; X86-AVX-NEXT: movl 52(%ecx), %ecx
|
|
|
|
; X86-AVX-NEXT: movl %ecx, 52(%eax)
|
|
|
|
; X86-AVX-NEXT: movl %edx, 48(%eax)
|
|
|
|
; X86-AVX-NEXT: vmovaps %xmm1, 32(%eax)
|
|
|
|
; X86-AVX-NEXT: vmovaps %ymm0, (%eax)
|
|
|
|
; X86-AVX-NEXT: vzeroupper
|
|
|
|
; X86-AVX-NEXT: retl $4
|
|
|
|
;
|
|
|
|
; X64-SSE-LABEL: load7_unaligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64-SSE: # %bb.0:
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-SSE-NEXT: movq %rdi, %rax
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-SSE-NEXT: movups (%rsi), %xmm0
|
|
|
|
; X64-SSE-NEXT: movups 16(%rsi), %xmm1
|
|
|
|
; X64-SSE-NEXT: movups 32(%rsi), %xmm2
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-SSE-NEXT: movq 48(%rsi), %rcx
|
|
|
|
; X64-SSE-NEXT: movq %rcx, 48(%rdi)
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-SSE-NEXT: movaps %xmm2, 32(%rdi)
|
|
|
|
; X64-SSE-NEXT: movaps %xmm1, 16(%rdi)
|
|
|
|
; X64-SSE-NEXT: movaps %xmm0, (%rdi)
|
|
|
|
; X64-SSE-NEXT: retq
|
|
|
|
;
|
|
|
|
; X64-AVX-LABEL: load7_unaligned:
|
2017-12-05 01:18:51 +08:00
|
|
|
; X64-AVX: # %bb.0:
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-AVX-NEXT: movq %rdi, %rax
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-AVX-NEXT: vmovups (%rsi), %ymm0
|
|
|
|
; X64-AVX-NEXT: vmovups 32(%rsi), %xmm1
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-AVX-NEXT: movq 48(%rsi), %rcx
|
|
|
|
; X64-AVX-NEXT: movq %rcx, 48(%rdi)
|
2017-10-09 03:18:10 +08:00
|
|
|
; X64-AVX-NEXT: vmovaps %xmm1, 32(%rdi)
|
|
|
|
; X64-AVX-NEXT: vmovaps %ymm0, (%rdi)
|
|
|
|
; X64-AVX-NEXT: vzeroupper
|
|
|
|
; X64-AVX-NEXT: retq
|
|
|
|
%x1 = load <7 x i64>, <7 x i64>* %x, align 1
|
|
|
|
ret <7 x i64> %x1
|
|
|
|
}
|