2016-09-10 05:36:17 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2015-03-09 23:02:01 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-pc-linux-gnu -mattr=+avx < %s | FileCheck %s
|
2015-03-04 15:27:39 +08:00
|
|
|
|
2020-12-31 06:40:50 +08:00
|
|
|
@in = dso_local global <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, align 32
|
|
|
|
@out = dso_local global <2 x i64> zeroinitializer, align 16
|
2015-03-04 15:27:39 +08:00
|
|
|
|
2020-12-31 06:40:50 +08:00
|
|
|
define dso_local i32 @_Z3foov() {
|
2016-09-10 05:36:17 +08:00
|
|
|
; CHECK-LABEL: _Z3foov:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
[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
|
|
|
; CHECK-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
|
2021-06-12 04:26:17 +08:00
|
|
|
; CHECK-NEXT: vmovaps %xmm0, out(%rip)
|
2016-09-10 05:36:17 +08:00
|
|
|
; CHECK-NEXT: xorl %eax, %eax
|
|
|
|
; CHECK-NEXT: retq
|
2015-03-04 15:27:39 +08:00
|
|
|
entry:
|
|
|
|
%0 = load <4 x i64>, <4 x i64>* @in, align 32
|
|
|
|
%vecext = extractelement <4 x i64> %0, i32 0
|
|
|
|
%vecinit = insertelement <2 x i64> undef, i64 %vecext, i32 0
|
|
|
|
%vecinit1 = insertelement <2 x i64> %vecinit, i64 0, i32 1
|
|
|
|
store <2 x i64> %vecinit1, <2 x i64>* @out, align 16
|
|
|
|
ret i32 0
|
|
|
|
}
|