1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-slow-unaligned-mem-16 | FileCheck %s --check-prefix=FAST
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+slow-unaligned-mem-16 | FileCheck %s --check-prefix=SLOW
5 ; Verify that the DAGCombiner is creating unaligned 16-byte loads and stores
6 ; if and only if those are fast.
8 define void @merge_const_vec_store(ptr %ptr) {
9 ; FAST-LABEL: merge_const_vec_store:
11 ; FAST-NEXT: xorps %xmm0, %xmm0
12 ; FAST-NEXT: movups %xmm0, (%rdi)
15 ; SLOW-LABEL: merge_const_vec_store:
17 ; SLOW-NEXT: movq $0, (%rdi)
18 ; SLOW-NEXT: movq $0, 8(%rdi)
21 %idx1 = getelementptr i64, ptr %ptr, i64 1
23 store i64 0, ptr %ptr, align 8
24 store i64 0, ptr %idx1, align 8
29 define void @merge_vec_element_store(<4 x double> %v, ptr %ptr) {
30 ; FAST-LABEL: merge_vec_element_store:
32 ; FAST-NEXT: movups %xmm0, (%rdi)
35 ; SLOW-LABEL: merge_vec_element_store:
37 ; SLOW-NEXT: movlps %xmm0, (%rdi)
38 ; SLOW-NEXT: movhps %xmm0, 8(%rdi)
41 %vecext0 = extractelement <4 x double> %v, i32 0
42 %vecext1 = extractelement <4 x double> %v, i32 1
44 %idx1 = getelementptr double, ptr %ptr, i64 1
46 store double %vecext0, ptr %ptr, align 8
47 store double %vecext1, ptr %idx1, align 8
52 define void @merge_vec_load_and_stores(ptr%ptr) {
53 ; FAST-LABEL: merge_vec_load_and_stores:
55 ; FAST-NEXT: movups (%rdi), %xmm0
56 ; FAST-NEXT: movups %xmm0, 40(%rdi)
59 ; SLOW-LABEL: merge_vec_load_and_stores:
61 ; SLOW-NEXT: movq (%rdi), %rax
62 ; SLOW-NEXT: movq 8(%rdi), %rcx
63 ; SLOW-NEXT: movq %rax, 40(%rdi)
64 ; SLOW-NEXT: movq %rcx, 48(%rdi)
67 %idx1 = getelementptr i64, ptr %ptr, i64 1
69 %ld0 = load i64, ptr %ptr, align 4
70 %ld1 = load i64, ptr %idx1, align 4
72 %idx4 = getelementptr i64, ptr %ptr, i64 5
73 %idx5 = getelementptr i64, ptr %ptr, i64 6
75 store i64 %ld0, ptr %idx4, align 4
76 store i64 %ld1, ptr %idx5, align 4