You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1829,123 +1829,8 @@ define <8 x double> @buildvec_v8f64_zvl512(double %e0, double %e1, double %e2, d
1829
1829
ret <8 x double> %v7
1830
1830
}
1831
1831
1832
-
define <8 x double> @buildvec_slideup(<4 x double> %v, double%e0, double%e1, double%e2, double%e3, double%e4, double%e5, double%e6) vscale_range(4, 128) {
1833
-
; CHECK-LABEL: buildvec_slideup:
1834
-
; CHECK: # %bb.0:
1835
-
; CHECK-NEXT: vsetivli zero, 8, e64, m2, ta, ma
1836
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa6
1837
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa5
1838
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa4
1839
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa3
1840
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa2
1841
-
; CHECK-NEXT: vfslide1up.vf v12, v10, fa1
1842
-
; CHECK-NEXT: vfslide1up.vf v8, v12, fa0
1843
-
; CHECK-NEXT: ret
1844
-
%v0 = insertelement <8 x double> poison, double%e0, i640
1845
-
%v1 = insertelement <8 x double> %v0, double%e1, i641
1846
-
%v2 = insertelement <8 x double> %v1, double%e2, i642
1847
-
%v3 = insertelement <8 x double> %v2, double%e3, i643
1848
-
%v4 = insertelement <8 x double> %v3, double%e4, i644
1849
-
%v5 = insertelement <8 x double> %v4, double%e5, i645
1850
-
%v6 = insertelement <8 x double> %v5, double%e6, i646
1851
-
%e7 = extractelement <4 x double> %v, i640
1852
-
%v7 = insertelement <8 x double> %v6, double%e7, i647
1853
-
ret <8 x double> %v7
1854
-
}
1855
-
1856
-
define <8 x double> @buildvec_slideup_leading_undef(<4 x double> %v, double%e0, double%e1, double%e2, double%e3, double%e4) vscale_range(4, 128) {
1857
-
; CHECK-LABEL: buildvec_slideup_leading_undef:
1858
-
; CHECK: # %bb.0:
1859
-
; CHECK-NEXT: vsetivli zero, 8, e64, m2, ta, ma
1860
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa4
1861
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa3
1862
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa2
1863
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa1
1864
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa0
1865
-
; CHECK-NEXT: vslideup.vi v8, v10, 2
1866
-
; CHECK-NEXT: ret
1867
-
%v2 = insertelement <8 x double> poison, double%e0, i642
1868
-
%v3 = insertelement <8 x double> %v2, double%e1, i643
1869
-
%v4 = insertelement <8 x double> %v3, double%e2, i644
1870
-
%v5 = insertelement <8 x double> %v4, double%e3, i645
1871
-
%v6 = insertelement <8 x double> %v5, double%e4, i646
1872
-
%e5 = extractelement <4 x double> %v, i640
1873
-
%v7 = insertelement <8 x double> %v6, double%e5, i647
1874
-
ret <8 x double> %v7
1875
-
}
1876
-
1877
-
define <8 x double> @buildvec_slideup_mid_undef(<4 x double> %v, double%e0, double%e1, double%e2, double%e3, double%e4) vscale_range(4, 128) {
1878
-
; CHECK-LABEL: buildvec_slideup_mid_undef:
1879
-
; CHECK: # %bb.0:
1880
-
; CHECK-NEXT: vsetivli zero, 8, e64, m2, ta, ma
1881
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa4
1882
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa3
1883
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa2
1884
-
; CHECK-NEXT: vslideup.vi v8, v10, 2
1885
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa1
1886
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa0
1887
-
; CHECK-NEXT: ret
1888
-
%v0 = insertelement <8 x double> poison, double%e0, i640
1889
-
%v1 = insertelement <8 x double> %v0, double%e1, i641
1890
-
%v4 = insertelement <8 x double> %v1, double%e2, i644
1891
-
%v5 = insertelement <8 x double> %v4, double%e3, i645
1892
-
%v6 = insertelement <8 x double> %v5, double%e4, i646
1893
-
%e5 = extractelement <4 x double> %v, i640
1894
-
%v7 = insertelement <8 x double> %v6, double%e5, i647
1895
-
ret <8 x double> %v7
1896
-
}
1897
-
1898
-
define <8 x double> @buildvec_slideup_trailing_undef(<4 x double> %v, double%e0, double%e1, double%e2, double%e3, double%e4) vscale_range(4, 128) {
1899
-
; CHECK-LABEL: buildvec_slideup_trailing_undef:
1900
-
; CHECK: # %bb.0:
1901
-
; CHECK-NEXT: vsetivli zero, 8, e64, m2, ta, ma
1902
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa4
1903
-
; CHECK-NEXT: vfslide1up.vf v8, v10, fa3
1904
-
; CHECK-NEXT: vfslide1up.vf v10, v8, fa2
1905
-
; CHECK-NEXT: vfslide1up.vf v12, v10, fa1
1906
-
; CHECK-NEXT: vfslide1up.vf v8, v12, fa0
1907
-
; CHECK-NEXT: ret
1908
-
%v0 = insertelement <8 x double> poison, double%e0, i640
1909
-
%v1 = insertelement <8 x double> %v0, double%e1, i641
1910
-
%v2 = insertelement <8 x double> %v1, double%e2, i642
1911
-
%v3 = insertelement <8 x double> %v2, double%e3, i643
1912
-
%v4 = insertelement <8 x double> %v3, double%e4, i644
1913
-
%e5 = extractelement <4 x double> %v, i640
1914
-
%v5 = insertelement <8 x double> %v4, double%e5, i645
1915
-
%v6 = insertelement <8 x double> %v5, double poison, i646
1916
-
%v7 = insertelement <8 x double> %v6, double poison, i647
1917
-
ret <8 x double> %v7
1918
-
}
1919
-
1920
-
; Negative test for slideup lowering where the extract_element was not build_vector's last operand.
1921
-
define <8 x double> @buildvec_slideup_not_last_element(<4 x double> %v, double%e0, double%e1, double%e2, double%e3, double%e4, double%e5, double%e7) vscale_range(4, 128) {
1922
-
; CHECK-LABEL: buildvec_slideup_not_last_element:
1923
-
; CHECK: # %bb.0:
1924
-
; CHECK-NEXT: vsetivli zero, 8, e64, m2, ta, ma
1925
-
; CHECK-NEXT: vfmv.f.s ft0, v8
1926
-
; CHECK-NEXT: vfmv.v.f v8, fa0
1927
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa1
1928
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa2
1929
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa3
1930
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa4
1931
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa5
1932
-
; CHECK-NEXT: vfslide1down.vf v8, v8, ft0
1933
-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa6
1934
-
; CHECK-NEXT: ret
1935
-
%v0 = insertelement <8 x double> poison, double%e0, i640
1936
-
%v1 = insertelement <8 x double> %v0, double%e1, i641
1937
-
%v2 = insertelement <8 x double> %v1, double%e2, i642
1938
-
%v3 = insertelement <8 x double> %v2, double%e3, i643
1939
-
%v4 = insertelement <8 x double> %v3, double%e4, i644
1940
-
%v5 = insertelement <8 x double> %v4, double%e5, i645
1941
-
%e6 = extractelement <4 x double> %v, i640
1942
-
%v6 = insertelement <8 x double> %v5, double%e6, i646
1943
-
%v7 = insertelement <8 x double> %v6, double%e7, i647
1944
-
ret <8 x double> %v7
1945
-
}
1946
-
1947
-
define <4 x float> @buildvec_vfredusum(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
1948
-
; CHECK-LABEL: buildvec_vfredusum:
1832
+
define <4 x float> @buildvec_vfredusum_slideup(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
1833
+
; CHECK-LABEL: buildvec_vfredusum_slideup:
1949
1834
; CHECK: # %bb.0:
1950
1835
; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
1951
1836
; CHECK-NEXT: vfmv.s.f v16, fa0
@@ -1972,8 +1857,118 @@ define <4 x float> @buildvec_vfredusum(float %start, <8 x float> %arg1, <8 x flo
1972
1857
ret <4 x float> %255
1973
1858
}
1974
1859
1975
-
define <4 x float> @buildvec_vfredosum(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
1976
-
; CHECK-LABEL: buildvec_vfredosum:
1860
+
define <8 x float> @buildvec_vfredusum_slideup_leading_undef(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
%252 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg1)
1878
+
%253 = insertelement <8 x float> poison, float%252, i644
1879
+
%254 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg2)
1880
+
%255 = insertelement <8 x float> %253, float%254, i645
1881
+
%256 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg3)
1882
+
%257 = insertelement <8 x float> %255, float%256, i646
1883
+
%258 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg4)
1884
+
%259 = insertelement <8 x float> %257, float%258, i647
1885
+
ret <8 x float> %259
1886
+
}
1887
+
1888
+
define <8 x float> @buildvec_vfredusum_slideup_trailing_undef(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
%252 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg1)
1905
+
%253 = insertelement <8 x float> poison, float%252, i640
1906
+
%254 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg2)
1907
+
%255 = insertelement <8 x float> %253, float%254, i641
1908
+
%256 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg3)
1909
+
%257 = insertelement <8 x float> %255, float%256, i642
1910
+
%258 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg4)
1911
+
%259 = insertelement <8 x float> %257, float%258, i643
1912
+
ret <8 x float> %259
1913
+
}
1914
+
1915
+
; Negative test case checking if we generate slideup only when all build_vec operands are extraction from the first vector element.
1916
+
define <8 x float> @buildvec_vfredusum_slideup_not_extract_first(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
%252 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg1)
1933
+
%253 = insertelement <8 x float> poison, float%252, i640
1934
+
%255 = insertelement <8 x float> %253, float%start, i641
1935
+
%256 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg3)
1936
+
%257 = insertelement <8 x float> %255, float%256, i642
1937
+
%258 = tailcall reassoc float@llvm.vector.reduce.fadd.v8f32(float%start, <8 x float> %arg4)
1938
+
%259 = insertelement <8 x float> %257, float%258, i643
1939
+
ret <8 x float> %259
1940
+
}
1941
+
1942
+
define <8 x float> @buildvec_vfredusum_slideup_mid_undef(float%start, <8 x float> %arg1, <8 x float> %arg2, <8 x float> %arg3, <8 x float> %arg4) nounwind {
0 commit comments