[llvm] r323556 - [SLP] Test for trunc vectorization, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 26 12:07:55 PST 2018
Author: abataev
Date: Fri Jan 26 12:07:55 2018
New Revision: 323556
URL: http://llvm.org/viewvc/llvm-project?rev=323556&view=rev
Log:
[SLP] Test for trunc vectorization, NFC.
Modified:
llvm/trunk/test/Transforms/SLPVectorizer/X86/sign-extend.ll
Modified: llvm/trunk/test/Transforms/SLPVectorizer/X86/sign-extend.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/sign-extend.ll?rev=323556&r1=323555&r2=323556&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/sign-extend.ll (original)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/sign-extend.ll Fri Jan 26 12:07:55 2018
@@ -30,3 +30,36 @@ entry:
%vecinit9 = insertelement <4 x i32> %vecinit6, i32 %conv8, i32 3
ret <4 x i32> %vecinit9
}
+
+define <4 x i16> @truncate_v_v(<4 x i32> %lhs) {
+; CHECK-LABEL: @truncate_v_v(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[VECEXT:%.*]] = extractelement <4 x i32> [[LHS:%.*]], i32 0
+; CHECK-NEXT: [[CONV:%.*]] = trunc i32 [[VECEXT]] to i16
+; CHECK-NEXT: [[VECINIT:%.*]] = insertelement <4 x i16> undef, i16 [[CONV]], i32 0
+; CHECK-NEXT: [[VECEXT1:%.*]] = extractelement <4 x i32> [[LHS]], i32 1
+; CHECK-NEXT: [[CONV2:%.*]] = trunc i32 [[VECEXT1]] to i16
+; CHECK-NEXT: [[VECINIT3:%.*]] = insertelement <4 x i16> [[VECINIT]], i16 [[CONV2]], i32 1
+; CHECK-NEXT: [[VECEXT4:%.*]] = extractelement <4 x i32> [[LHS]], i32 2
+; CHECK-NEXT: [[CONV5:%.*]] = trunc i32 [[VECEXT4]] to i16
+; CHECK-NEXT: [[VECINIT6:%.*]] = insertelement <4 x i16> [[VECINIT3]], i16 [[CONV5]], i32 2
+; CHECK-NEXT: [[VECEXT7:%.*]] = extractelement <4 x i32> [[LHS]], i32 3
+; CHECK-NEXT: [[CONV8:%.*]] = trunc i32 [[VECEXT7]] to i16
+; CHECK-NEXT: [[VECINIT9:%.*]] = insertelement <4 x i16> [[VECINIT6]], i16 [[CONV8]], i32 3
+; CHECK-NEXT: ret <4 x i16> [[VECINIT9]]
+;
+entry:
+ %vecext = extractelement <4 x i32> %lhs, i32 0
+ %conv = trunc i32 %vecext to i16
+ %vecinit = insertelement <4 x i16> undef, i16 %conv, i32 0
+ %vecext1 = extractelement <4 x i32> %lhs, i32 1
+ %conv2 = trunc i32 %vecext1 to i16
+ %vecinit3 = insertelement <4 x i16> %vecinit, i16 %conv2, i32 1
+ %vecext4 = extractelement <4 x i32> %lhs, i32 2
+ %conv5 = trunc i32 %vecext4 to i16
+ %vecinit6 = insertelement <4 x i16> %vecinit3, i16 %conv5, i32 2
+ %vecext7 = extractelement <4 x i32> %lhs, i32 3
+ %conv8 = trunc i32 %vecext7 to i16
+ %vecinit9 = insertelement <4 x i16> %vecinit6, i16 %conv8, i32 3
+ ret <4 x i16> %vecinit9
+}
More information about the llvm-commits
mailing list