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-gnu -mattr=+v -slp-threshold=-11 < %s | FileCheck %s
4 define <4 x i32> @test(<2 x i64> %v, ptr %p) {
5 ; CHECK-LABEL: define <4 x i32> @test(
6 ; CHECK-SAME: <2 x i64> [[V:%.*]], ptr [[P:%.*]]) #[[ATTR0:[0-9]+]] {
8 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x ptr> poison, ptr [[P]], i32 0
9 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x ptr> [[TMP0]], <2 x ptr> poison, <2 x i32> zeroinitializer
10 ; CHECK-NEXT: [[TMP2:%.*]] = getelementptr i16, <2 x ptr> [[TMP1]], <2 x i64> [[V]]
11 ; CHECK-NEXT: [[TMP3:%.*]] = call <2 x i16> @llvm.masked.gather.v2i16.v2p0(<2 x ptr> [[TMP2]], i32 2, <2 x i1> <i1 true, i1 true>, <2 x i16> poison)
12 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x i16> [[TMP3]], <2 x i16> poison, <2 x i32> <i32 1, i32 0>
13 ; CHECK-NEXT: [[TMP7:%.*]] = zext <2 x i16> [[TMP4]] to <2 x i32>
14 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x i32> [[TMP7]], <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
15 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> zeroinitializer, <4 x i32> [[TMP6]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
16 ; CHECK-NEXT: ret <4 x i32> [[TMP5]]
19 %0 = extractelement <2 x i64> %v, i32 1
20 %arrayidx127.2 = getelementptr i16, ptr %p, i64 %0
21 %1 = load i16, ptr %arrayidx127.2, align 2
22 %conv128.2 = zext i16 %1 to i32
23 %2 = extractelement <2 x i64> %v, i32 0
24 %arrayidx127.3 = getelementptr i16, ptr %p, i64 %2
25 %3 = load i16, ptr %arrayidx127.3, align 2
26 %conv128.3 = zext i16 %3 to i32
27 %4 = insertelement <4 x i32> zeroinitializer, i32 %conv128.2, i32 0
28 %5 = insertelement <4 x i32> %4, i32 %conv128.3, i32 1