summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-08-19 12:41:09 +0000
committerSanjay Patel <spatel@rotateright.com>2019-08-19 12:41:09 +0000
commit0f9b5f86f1cd06c4a7fc9679d44f334796be653f (patch)
treee71a03b4c84b2a90f0fcc7ce5b47c559c5f84bdd
parent6520ba3e94eb219a779c4e69d15f0464c325fb97 (diff)
downloadbcm5719-llvm-0f9b5f86f1cd06c4a7fc9679d44f334796be653f.tar.gz
bcm5719-llvm-0f9b5f86f1cd06c4a7fc9679d44f334796be653f.zip
[SLP] add test that requires shuffle of scalars; NFC
llvm-svn: 369255
-rw-r--r--llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll b/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll
index fe31e8e8f7d..e416f29d1a5 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll
+++ b/llvm/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> <i32 0, i32 0, i32 1, i32 1>
+; 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*
OpenPOWER on IntegriCloud