1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S < %s -mtriple=riscv64-unknown-linux -mattr=+v | FileCheck %s
4 define void @store_reverse(ptr %p3) {
5 ; CHECK-LABEL: @store_reverse(
7 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i64, ptr [[P3:%.*]], i64 8
8 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i64, ptr [[P3]], i64 7
9 ; CHECK-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[P3]], align 8
10 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i64>, ptr [[ARRAYIDX1]], align 8
11 ; CHECK-NEXT: [[TMP2:%.*]] = shl <4 x i64> [[TMP0]], [[TMP1]]
12 ; CHECK-NEXT: call void @llvm.experimental.vp.strided.store.v4i64.p0.i64(<4 x i64> [[TMP2]], ptr align 8 [[ARRAYIDX2]], i64 -8, <4 x i1> splat (i1 true), i32 4)
13 ; CHECK-NEXT: ret void
16 %0 = load i64, ptr %p3, align 8
17 %arrayidx1 = getelementptr inbounds i64, ptr %p3, i64 8
18 %1 = load i64, ptr %arrayidx1, align 8
20 %arrayidx2 = getelementptr inbounds i64, ptr %p3, i64 7
21 store i64 %shl, ptr %arrayidx2, align 8
22 %arrayidx3 = getelementptr inbounds i64, ptr %p3, i64 1
23 %2 = load i64, ptr %arrayidx3, align 8
24 %arrayidx4 = getelementptr inbounds i64, ptr %p3, i64 9
25 %3 = load i64, ptr %arrayidx4, align 8
26 %shl5 = shl i64 %2, %3
27 %arrayidx6 = getelementptr inbounds i64, ptr %p3, i64 6
28 store i64 %shl5, ptr %arrayidx6, align 8
29 %arrayidx7 = getelementptr inbounds i64, ptr %p3, i64 2
30 %4 = load i64, ptr %arrayidx7, align 8
31 %arrayidx8 = getelementptr inbounds i64, ptr %p3, i64 10
32 %5 = load i64, ptr %arrayidx8, align 8
33 %shl9 = shl i64 %4, %5
34 %arrayidx10 = getelementptr inbounds i64, ptr %p3, i64 5
35 store i64 %shl9, ptr %arrayidx10, align 8
36 %arrayidx11 = getelementptr inbounds i64, ptr %p3, i64 3
37 %6 = load i64, ptr %arrayidx11, align 8
38 %arrayidx12 = getelementptr inbounds i64, ptr %p3, i64 11
39 %7 = load i64, ptr %arrayidx12, align 8
40 %shl13 = shl i64 %6, %7
41 %arrayidx14 = getelementptr inbounds i64, ptr %p3, i64 4
42 store i64 %shl13, ptr %arrayidx14, align 8