1d584df6cSAlexey Bataev; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 2d584df6cSAlexey Bataev; RUN: opt -S -passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v < %s | FileCheck %s 3d584df6cSAlexey Bataev 4d584df6cSAlexey Bataevdefine <4 x i32> @test(i16 %0, i16 %1) { 5d584df6cSAlexey Bataev; CHECK-LABEL: define <4 x i32> @test( 6d584df6cSAlexey Bataev; CHECK-SAME: i16 [[TMP0:%.*]], i16 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { 7d584df6cSAlexey Bataev; CHECK-NEXT: entry: 8d584df6cSAlexey Bataev; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i16> <i16 poison, i16 0>, i16 [[TMP1]], i32 0 9a4760321SAlexey Bataev; CHECK-NEXT: [[TMP3:%.*]] = zext <2 x i16> [[TMP2]] to <2 x i32> 10a4760321SAlexey Bataev; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x i32> [[TMP3]], <2 x i32> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1> 11d584df6cSAlexey Bataev; CHECK-NEXT: [[CONV15_I:%.*]] = sext i16 [[TMP0]] to i32 12*38fffa63SPaul Walker; CHECK-NEXT: [[TMP5:%.*]] = xor <4 x i32> [[TMP4]], splat (i32 -1) 13a4760321SAlexey Bataev; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>, i32 [[CONV15_I]], i32 1 14a4760321SAlexey Bataev; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP6]], <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 1, i32 1> 15a4760321SAlexey Bataev; CHECK-NEXT: [[TMP8:%.*]] = call <4 x i32> @llvm.smax.v4i32(<4 x i32> [[TMP5]], <4 x i32> [[TMP7]]) 16*38fffa63SPaul Walker; CHECK-NEXT: [[TMP9:%.*]] = and <4 x i32> [[TMP8]], splat (i32 65535) 17d584df6cSAlexey Bataev; CHECK-NEXT: ret <4 x i32> [[TMP9]] 18d584df6cSAlexey Bataev; 19d584df6cSAlexey Bataeventry: 20d584df6cSAlexey Bataev %conv13.1.i = zext i16 %1 to i32 21d584df6cSAlexey Bataev %not.i = xor i32 %conv13.1.i, -1 22d584df6cSAlexey Bataev %cond19.i = tail call i32 @llvm.smax.i32(i32 %not.i, i32 0) 23d584df6cSAlexey Bataev %conv21.i = and i32 %cond19.i, 65535 24d584df6cSAlexey Bataev %not.1.i = xor i32 %conv13.1.i, -1 25d584df6cSAlexey Bataev %conv15.i = sext i16 %0 to i32 26d584df6cSAlexey Bataev %cond19.1.i = tail call i32 @llvm.smax.i32(i32 %not.1.i, i32 %conv15.i) 27d584df6cSAlexey Bataev %conv21.1.i = and i32 %cond19.1.i, 65535 28d584df6cSAlexey Bataev %not.2.i = xor i32 %conv13.1.i, -1 29d584df6cSAlexey Bataev %cond19.2.i = tail call i32 @llvm.smax.i32(i32 %not.2.i, i32 %conv15.i) 30d584df6cSAlexey Bataev %conv21.2.i = and i32 %cond19.2.i, 65535 31d584df6cSAlexey Bataev %conv13.3.i = zext i16 0 to i32 32d584df6cSAlexey Bataev %not.3.i = xor i32 %conv13.3.i, -1 33d584df6cSAlexey Bataev %cond19.3.i = tail call i32 @llvm.smax.i32(i32 %not.3.i, i32 %conv15.i) 34d584df6cSAlexey Bataev %conv21.3.i = and i32 %cond19.3.i, 65535 35d584df6cSAlexey Bataev %ins1 = insertelement <4 x i32> poison, i32 %conv21.i, i32 0 36d584df6cSAlexey Bataev %ins2 = insertelement <4 x i32> %ins1, i32 %conv21.1.i, i32 1 37d584df6cSAlexey Bataev %ins3 = insertelement <4 x i32> %ins2, i32 %conv21.2.i, i32 2 38d584df6cSAlexey Bataev %ins4 = insertelement <4 x i32> %ins3, i32 %conv21.3.i, i32 3 39d584df6cSAlexey Bataev ret <4 x i32> %ins4 40d584df6cSAlexey Bataev} 41