1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -slp-vectorizer -mtriple=riscv64 -mattr=+v \
3 ; RUN: -riscv-v-vector-bits-min=-1 -S | FileCheck %s --check-prefixes=CHECK
5 define void @simple_copy(ptr %dest, ptr %p) {
6 ; CHECK-LABEL: @simple_copy(
8 ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i16>, ptr [[P:%.*]], align 4
9 ; CHECK-NEXT: store <2 x i16> [[TMP0]], ptr [[DEST:%.*]], align 4
10 ; CHECK-NEXT: ret void
13 %e0 = load i16, ptr %p, align 4
14 %inc = getelementptr inbounds i16, ptr %p, i64 1
15 %e1 = load i16, ptr %inc, align 2
17 store i16 %e0, ptr %dest, align 4
18 %inc2 = getelementptr inbounds i16, ptr %dest, i64 1
19 store i16 %e1, ptr %inc2, align 2
23 define void @vec_add(ptr %dest, ptr %p) {
24 ; CHECK-LABEL: @vec_add(
26 ; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i16>, ptr [[P:%.*]], align 4
27 ; CHECK-NEXT: [[TMP1:%.*]] = add <2 x i16> [[TMP0]], <i16 1, i16 1>
28 ; CHECK-NEXT: store <2 x i16> [[TMP1]], ptr [[DEST:%.*]], align 4
29 ; CHECK-NEXT: ret void
32 %e0 = load i16, ptr %p, align 4
33 %inc = getelementptr inbounds i16, ptr %p, i64 1
34 %e1 = load i16, ptr %inc, align 2
39 store i16 %a0, ptr %dest, align 4
40 %inc2 = getelementptr inbounds i16, ptr %dest, i64 1
41 store i16 %a1, ptr %inc2, align 2
46 define void @splat_store(ptr %dest, ptr %p) {
47 ; CHECK-LABEL: @splat_store(
49 ; CHECK-NEXT: [[E0:%.*]] = load i16, ptr [[P:%.*]], align 4
50 ; CHECK-NEXT: store i16 [[E0]], ptr [[DEST:%.*]], align 4
51 ; CHECK-NEXT: [[INC2:%.*]] = getelementptr inbounds i16, ptr [[DEST]], i64 1
52 ; CHECK-NEXT: store i16 [[E0]], ptr [[INC2]], align 2
53 ; CHECK-NEXT: ret void
56 %e0 = load i16, ptr %p, align 4
58 store i16 %e0, ptr %dest, align 4
59 %inc2 = getelementptr inbounds i16, ptr %dest, i64 1
60 store i16 %e0, ptr %inc2, align 2