[llvm] r323815 - [SLP] Add extra test for extractelement shuffle, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 13:06:06 PST 2018
Author: abataev
Date: Tue Jan 30 13:06:06 2018
New Revision: 323815
URL: http://llvm.org/viewvc/llvm-project?rev=323815&view=rev
Log:
[SLP] Add extra test for extractelement shuffle, NFC.
Added:
llvm/trunk/test/Transforms/SLPVectorizer/X86/extract-shuffle.ll
Added: llvm/trunk/test/Transforms/SLPVectorizer/X86/extract-shuffle.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/extract-shuffle.ll?rev=323815&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/extract-shuffle.ll (added)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/extract-shuffle.ll Tue Jan 30 13:06:06 2018
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -slp-vectorizer -S -o - -mtriple=x86-64-unknown-linux -mcpu=bdver2 -slp-schedule-budget=1 | FileCheck %s
+
+define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
+; CHECK-LABEL: @g(
+; CHECK-NEXT: [[X0:%.*]] = extractelement <2 x i8> [[X:%.*]], i32 0
+; CHECK-NEXT: [[Y1:%.*]] = extractelement <2 x i8> [[Y:%.*]], i32 1
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i8> undef, i8 [[X0]], i32 0
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i8> [[TMP1]], i8 [[Y1]], i32 1
+; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i8> [[TMP2]], [[TMP2]]
+; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x i8> [[TMP3]], i32 0
+; CHECK-NEXT: [[INS1:%.*]] = insertelement <2 x i8> undef, i8 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i8> [[TMP3]], i32 1
+; CHECK-NEXT: [[INS2:%.*]] = insertelement <2 x i8> [[INS1]], i8 [[TMP5]], i32 1
+; CHECK-NEXT: ret <2 x i8> [[INS2]]
+;
+ %x0 = extractelement <2 x i8> %x, i32 0
+ %y1 = extractelement <2 x i8> %y, i32 1
+ %x0x0 = mul i8 %x0, %x0
+ %y1y1 = mul i8 %y1, %y1
+ %ins1 = insertelement <2 x i8> undef, i8 %x0x0, i32 0
+ %ins2 = insertelement <2 x i8> %ins1, i8 %y1y1, i32 1
+ ret <2 x i8> %ins2
+}
+
More information about the llvm-commits
mailing list