1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux -mattr=+v < %s | FileCheck %s
4 define void @test(ptr noalias %p, ptr %p1) {
5 ; CHECK-LABEL: define void @test(
6 ; CHECK-SAME: ptr noalias [[P:%.*]], ptr [[P1:%.*]]) #[[ATTR0:[0-9]+]] {
7 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i16>, ptr [[P]], align 2
8 ; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i8, ptr [[P]], i64 16
9 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i16>, ptr [[GEP2]], align 2
10 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x i16> [[TMP1]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
11 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x i16> [[TMP2]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
12 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i16> [[TMP3]], <4 x i16> [[TMP4]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
13 ; CHECK-NEXT: store <4 x i16> [[TMP5]], ptr [[P1]], align 2
14 ; CHECK-NEXT: ret void
16 %l1 = load i16, ptr %p, align 2
17 %gep1 = getelementptr inbounds i8, ptr %p, i64 2
18 %l2 = load i16, ptr %gep1, align 2
19 %gep2 = getelementptr inbounds i8, ptr %p, i64 16
20 %l3 = load i16, ptr %gep2, align 2
21 %gep3 = getelementptr inbounds i8, ptr %p, i64 18
22 %l4 = load i16, ptr %gep3, align 2
23 store i16 %l1, ptr %p1, align 2
24 %geps1 = getelementptr inbounds i8, ptr %p1, i64 2
25 store i16 %l2, ptr %geps1, align 2
26 %geps2 = getelementptr inbounds i8, ptr %p1, i64 4
27 store i16 %l3, ptr %geps2, align 2
28 %geps3 = getelementptr inbounds i8, ptr %p1, i64 6
29 store i16 %l4, ptr %geps3, align 2