1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-- -mattr=+avx | FileCheck %s
3 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-- -mattr=+avx2 | FileCheck %s
5 define float @matching_scalar(ptr dereferenceable(16) %p) {
6 ; CHECK-LABEL: @matching_scalar(
7 ; CHECK-NEXT: [[R:%.*]] = load float, ptr [[P:%.*]], align 16
8 ; CHECK-NEXT: ret float [[R]]
10 %r = load float, ptr %p, align 16
14 define i32 @nonmatching_scalar(ptr dereferenceable(16) %p) {
15 ; CHECK-LABEL: @nonmatching_scalar(
16 ; CHECK-NEXT: [[R:%.*]] = load i32, ptr [[P:%.*]], align 16
17 ; CHECK-NEXT: ret i32 [[R]]
19 %r = load i32, ptr %p, align 16
23 define i64 @larger_scalar(ptr dereferenceable(16) %p) {
24 ; CHECK-LABEL: @larger_scalar(
25 ; CHECK-NEXT: [[R:%.*]] = load i64, ptr [[P:%.*]], align 16
26 ; CHECK-NEXT: ret i64 [[R]]
28 %r = load i64, ptr %p, align 16
32 define i8 @smaller_scalar(ptr dereferenceable(16) %p) {
33 ; CHECK-LABEL: @smaller_scalar(
34 ; CHECK-NEXT: [[R:%.*]] = load i8, ptr [[P:%.*]], align 16
35 ; CHECK-NEXT: ret i8 [[R]]
37 %r = load i8, ptr %p, align 16
41 define i8 @smaller_scalar_256bit_vec(ptr dereferenceable(32) %p) {
42 ; CHECK-LABEL: @smaller_scalar_256bit_vec(
43 ; CHECK-NEXT: [[R:%.*]] = load i8, ptr [[P:%.*]], align 32
44 ; CHECK-NEXT: ret i8 [[R]]
46 %r = load i8, ptr %p, align 32
50 define i8 @smaller_scalar_less_aligned(ptr dereferenceable(16) %p) {
51 ; CHECK-LABEL: @smaller_scalar_less_aligned(
52 ; CHECK-NEXT: [[R:%.*]] = load i8, ptr [[P:%.*]], align 4
53 ; CHECK-NEXT: ret i8 [[R]]
55 %r = load i8, ptr %p, align 4
59 define float @matching_scalar_small_deref(ptr dereferenceable(15) %p) {
60 ; CHECK-LABEL: @matching_scalar_small_deref(
61 ; CHECK-NEXT: [[R:%.*]] = load float, ptr [[P:%.*]], align 16
62 ; CHECK-NEXT: ret float [[R]]
64 %r = load float, ptr %p, align 16
68 define float @matching_scalar_volatile(ptr dereferenceable(16) %p) {
69 ; CHECK-LABEL: @matching_scalar_volatile(
70 ; CHECK-NEXT: [[R:%.*]] = load volatile float, ptr [[P:%.*]], align 16
71 ; CHECK-NEXT: ret float [[R]]
73 %r = load volatile float, ptr %p, align 16
77 define float @nonvector(ptr dereferenceable(16) %p) {
78 ; CHECK-LABEL: @nonvector(
79 ; CHECK-NEXT: [[R:%.*]] = load float, ptr [[P:%.*]], align 16
80 ; CHECK-NEXT: ret float [[R]]
82 %r = load float, ptr %p, align 16