From abd28ded2082cf080176761d56c1fa846ebd734b Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 19 Aug 2019 12:41:09 +0000 Subject: [PATCH] [SLP] add test that requires shuffle of scalars; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369255 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../SLPVectorizer/X86/load-merge.ll | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/Transforms/SLPVectorizer/X86/load-merge.ll b/test/Transforms/SLPVectorizer/X86/load-merge.ll index fe31e8e8f7d..e416f29d1a5 100644 --- a/test/Transforms/SLPVectorizer/X86/load-merge.ll +++ b/test/Transforms/SLPVectorizer/X86/load-merge.ll @@ -78,6 +78,32 @@ define <4 x float> @PR16739_byref(<4 x float>* nocapture readonly dereferenceabl ret <4 x float> %i3 } +define <4 x float> @PR16739_byref_alt(<4 x float>* nocapture readonly dereferenceable(16) %x) { +; CHECK-LABEL: @PR16739_byref_alt( +; CHECK-NEXT: [[GEP0:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X:%.*]], i64 0, i64 0 +; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds <4 x float>, <4 x float>* [[X]], i64 0, i64 1 +; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[GEP0]] to <2 x float>* +; CHECK-NEXT: [[TMP2:%.*]] = load <2 x float>, <2 x float>* [[TMP1]], align 4 +; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <2 x float> [[TMP2]], <2 x float> undef, <4 x i32> +; CHECK-NEXT: [[TMP3:%.*]] = extractelement <4 x float> [[SHUFFLE]], i32 0 +; CHECK-NEXT: [[I0:%.*]] = insertelement <4 x float> undef, float [[TMP3]], i32 0 +; CHECK-NEXT: [[I1:%.*]] = insertelement <4 x float> [[I0]], float [[TMP3]], i32 1 +; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[SHUFFLE]], i32 2 +; CHECK-NEXT: [[I2:%.*]] = insertelement <4 x float> [[I1]], float [[TMP4]], i32 2 +; CHECK-NEXT: [[I3:%.*]] = insertelement <4 x float> [[I2]], float [[TMP4]], i32 3 +; CHECK-NEXT: ret <4 x float> [[I3]] +; + %gep0 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 0 + %gep1 = getelementptr inbounds <4 x float>, <4 x float>* %x, i64 0, i64 1 + %x0 = load float, float* %gep0 + %x1 = load float, float* %gep1 + %i0 = insertelement <4 x float> undef, float %x0, i32 0 + %i1 = insertelement <4 x float> %i0, float %x0, i32 1 + %i2 = insertelement <4 x float> %i1, float %x1, i32 2 + %i3 = insertelement <4 x float> %i2, float %x1, i32 3 + ret <4 x float> %i3 +} + define <4 x float> @PR16739_byval(<4 x float>* nocapture readonly dereferenceable(16) %x) { ; CHECK-LABEL: @PR16739_byval( ; CHECK-NEXT: [[T0:%.*]] = bitcast <4 x float>* [[X:%.*]] to i64* -- 2.50.1