[llvm] aed5e3b - [SLP][NFC]Add a test for delaying of insertelements vectorization, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 15 13:28:03 PDT 2022
Author: Alexey Bataev
Date: 2022-08-15T13:26:51-07:00
New Revision: aed5e3bea138ce581d682158eb61c27b3cfdd6ec
URL: https://github.com/llvm/llvm-project/commit/aed5e3bea138ce581d682158eb61c27b3cfdd6ec
DIFF: https://github.com/llvm/llvm-project/commit/aed5e3bea138ce581d682158eb61c27b3cfdd6ec.diff
LOG: [SLP][NFC]Add a test for delaying of insertelements vectorization, NFC.
Added:
llvm/test/Transforms/SLPVectorizer/X86/insertelement-postpone.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/insertelement-postpone.ll b/llvm/test/Transforms/SLPVectorizer/X86/insertelement-postpone.ll
new file mode 100644
index 0000000000000..76e0d9de21181
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/insertelement-postpone.ll
@@ -0,0 +1,45 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -slp-vectorizer -mtriple x86_64-unknown-linux-gnu < %s | FileCheck %s
+
+define <4 x double> @test(double* %p2, double %i1754, double %i1781, double %i1778) {
+; CHECK-LABEL: @test(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[I1771:%.*]] = getelementptr inbounds double, double* [[P2:%.*]], i64 54
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[I1754:%.*]], i32 0
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> [[TMP0]], double [[I1778:%.*]], i32 1
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> [[TMP0]], double [[I1754]], i32 1
+; CHECK-NEXT: [[TMP3:%.*]] = fmul fast <2 x double> [[TMP1]], [[TMP2]]
+; CHECK-NEXT: [[I1792:%.*]] = fmul fast double [[I1754]], [[I1781:%.*]]
+; CHECK-NEXT: [[TMP4:%.*]] = bitcast double* [[I1771]] to <2 x double>*
+; CHECK-NEXT: [[TMP5:%.*]] = load <2 x double>, <2 x double>* [[TMP4]], align 8
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> [[TMP0]], double [[I1781]], i32 1
+; CHECK-NEXT: [[TMP7:%.*]] = fmul fast <2 x double> [[TMP5]], [[TMP6]]
+; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x double> [[TMP7]], i32 1
+; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <2 x double> [[TMP3]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x double> [[TMP10]], double [[I1792]], i32 2
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x double> [[TMP11]], double [[TMP8]], i32 3
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double poison>, double [[TMP9]], i32 3
+; CHECK-NEXT: [[TMP14:%.*]] = fadd fast <4 x double> [[TMP12]], [[TMP13]]
+; CHECK-NEXT: ret <4 x double> [[TMP14]]
+;
+entry:
+ %i1771 = getelementptr inbounds double, double* %p2, i64 54
+ %i1772 = load double, double* %i1771, align 8
+ %i1773 = fmul fast double %i1772, %i1754
+ %i1782 = fmul fast double %i1754, %i1754
+ %i1783 = fadd fast double %i1782, 1.000000e+00
+ %i1787 = fmul fast double %i1778, %i1754
+ %i1788 = fadd fast double %i1787, 1.000000e+00
+ %i1792 = fmul fast double %i1754, %i1781
+ %i1793 = fadd fast double %i1792, 1.000000e+00
+ %i1795 = getelementptr inbounds double, double* %p2, i64 55
+ %i1796 = load double, double* %i1795, align 8
+ %i1797 = fmul fast double %i1796, %i1781
+ %i1798 = fadd fast double %i1773, %i1797
+ %i1976 = insertelement <4 x double> zeroinitializer, double %i1783, i64 0
+ %i1982 = insertelement <4 x double> %i1976, double %i1788, i64 1
+ %i1988 = insertelement <4 x double> %i1982, double %i1793, i64 2
+ %i1994 = insertelement <4 x double> %i1988, double %i1798, i64 3
+ ret <4 x double> %i1994
+}
More information about the llvm-commits
mailing list