Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit dd7a300

Browse files
committed
Unaligned loads should use the VMOVUPS opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177130 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent cacff67 commit dd7a300

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

lib/Target/X86/X86InstrSSE.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ let Predicates = [HasAVX] in {
10091009
(VMOVUPSmr addr:$dst, (v4i32 (EXTRACT_SUBREG VR256:$src,sub_xmm)))>;
10101010
def : Pat<(store (v8i16 (extract_subvector
10111011
(v16i16 VR256:$src), (iPTR 0))), addr:$dst),
1012-
(VMOVAPSmr addr:$dst, (v8i16 (EXTRACT_SUBREG VR256:$src,sub_xmm)))>;
1012+
(VMOVUPSmr addr:$dst, (v8i16 (EXTRACT_SUBREG VR256:$src,sub_xmm)))>;
10131013
def : Pat<(store (v16i8 (extract_subvector
10141014
(v32i8 VR256:$src), (iPTR 0))), addr:$dst),
10151015
(VMOVUPSmr addr:$dst, (v16i8 (EXTRACT_SUBREG VR256:$src,sub_xmm)))>;

test/CodeGen/X86/avx-load-store.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define void @storev16i16(<16 x i16> %a) nounwind {
5555

5656
; CHECK: storev16i16_01
5757
; CHECK: vextractf128
58-
; CHECK: vmovaps %xmm
58+
; CHECK: vmovups %xmm
5959
define void @storev16i16_01(<16 x i16> %a) nounwind {
6060
store <16 x i16> %a, <16 x i16>* undef, align 4
6161
unreachable

test/CodeGen/X86/vec_align_i256.ll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: llc < %s -mcpu=corei7-avx | FileCheck %s
2+
3+
; Make sure that we are not generating a movaps because the vector is aligned to 1.
4+
;CHECK: @foo
5+
;CHECK: xor
6+
;CHECK-NEXT: vmovups
7+
;CHECK-NEXT: ret
8+
define void @foo() {
9+
store <16 x i16> zeroinitializer, <16 x i16>* undef, align 1
10+
ret void
11+
}

0 commit comments

Comments
 (0)