@@ -17,6 +17,21 @@ entry:
1717 ret half %rdx.fadd
1818}
1919
20+ define noundef half @test_length_half2_start1 (<2 x half > noundef %p0 ) {
21+ ; CHECK-LABEL: define noundef half @test_length_half2_start1(
22+ ; CHECK-SAME: <2 x half> noundef [[P0:%.*]]) {
23+ ; CHECK-NEXT: [[ENTRY:.*:]]
24+ ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <2 x half> [[P0]], i64 0
25+ ; CHECK-NEXT: [[TMP1:%.*]] = fadd half [[TMP0]], 0xH0001
26+ ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x half> [[P0]], i64 1
27+ ; CHECK-NEXT: [[TMP3:%.*]] = fadd half [[TMP1]], [[TMP2]]
28+ ; CHECK-NEXT: ret half [[TMP3]]
29+ ;
30+ entry:
31+ %rdx.fadd = call half @llvm.vector.reduce.fadd.v2f16 (half 0xH0001, <2 x half > %p0 )
32+ ret half %rdx.fadd
33+ }
34+
2035define noundef half @test_length_half3 (<3 x half > noundef %p0 ) {
2136; CHECK-LABEL: define noundef half @test_length_half3(
2237; CHECK-SAME: <3 x half> noundef [[P0:%.*]]) {
@@ -81,6 +96,23 @@ entry:
8196 ret float %rdx.fadd
8297}
8398
99+ define noundef float @test_length_float3_start1 (<3 x float > noundef %p0 ) {
100+ ; CHECK-LABEL: define noundef float @test_length_float3_start1(
101+ ; CHECK-SAME: <3 x float> noundef [[P0:%.*]]) {
102+ ; CHECK-NEXT: [[ENTRY:.*:]]
103+ ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <3 x float> [[P0]], i64 0
104+ ; CHECK-NEXT: [[TMP1:%.*]] = fadd float [[TMP0]], 1.000000e+00
105+ ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <3 x float> [[P0]], i64 1
106+ ; CHECK-NEXT: [[TMP3:%.*]] = fadd float [[TMP1]], [[TMP2]]
107+ ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <3 x float> [[P0]], i64 2
108+ ; CHECK-NEXT: [[TMP5:%.*]] = fadd float [[TMP3]], [[TMP4]]
109+ ; CHECK-NEXT: ret float [[TMP5]]
110+ ;
111+ entry:
112+ %rdx.fadd = call float @llvm.vector.reduce.fadd.v3f32 (float 1 .000000e+00 , <3 x float > %p0 )
113+ ret float %rdx.fadd
114+ }
115+
84116define noundef float @test_length_float4 (<4 x float > noundef %p0 ) {
85117; CHECK-LABEL: define noundef float @test_length_float4(
86118; CHECK-SAME: <4 x float> noundef [[P0:%.*]]) {
@@ -147,6 +179,25 @@ entry:
147179 ret double %rdx.fadd
148180}
149181
182+ define noundef double @test_length_double4_start1 (<4 x double > noundef %p0 ) {
183+ ; CHECK-LABEL: define noundef double @test_length_double4_start1(
184+ ; CHECK-SAME: <4 x double> noundef [[P0:%.*]]) {
185+ ; CHECK-NEXT: [[ENTRY:.*:]]
186+ ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <4 x double> [[P0]], i64 0
187+ ; CHECK-NEXT: [[TMP1:%.*]] = fadd double [[TMP0]], 1.000000e+00
188+ ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x double> [[P0]], i64 1
189+ ; CHECK-NEXT: [[TMP3:%.*]] = fadd double [[TMP1]], [[TMP2]]
190+ ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x double> [[P0]], i64 2
191+ ; CHECK-NEXT: [[TMP5:%.*]] = fadd double [[TMP3]], [[TMP4]]
192+ ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x double> [[P0]], i64 3
193+ ; CHECK-NEXT: [[TMP7:%.*]] = fadd double [[TMP5]], [[TMP6]]
194+ ; CHECK-NEXT: ret double [[TMP7]]
195+ ;
196+ entry:
197+ %rdx.fadd = call double @llvm.vector.reduce.fadd.v4f64 (double 1 .000000e+00 , <4 x double > %p0 )
198+ ret double %rdx.fadd
199+ }
200+
150201define noundef i16 @test_length_short2 (<2 x i16 > noundef %p0 ) {
151202; CHECK-LABEL: define noundef i16 @test_length_short2(
152203; CHECK-SAME: <2 x i16> noundef [[P0:%.*]]) {
0 commit comments