Skip to content

Commit c9ad5be

Browse files
committed
[SLP][NFC]Add a test with the incorrect type promotion after bitwidth analysis, NFC
1 parent e15025d commit c9ad5be

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define <4 x float> @test(i64 %0) {
5+
; CHECK-LABEL: define <4 x float> @test(
6+
; CHECK-SAME: i64 [[TMP0:%.*]]) {
7+
; CHECK-NEXT: [[ENTRY:.*:]]
8+
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32
9+
; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> <i32 0, i32 0, i32 poison, i32 0>, i32 [[TMP1]], i32 2
10+
; CHECK-NEXT: [[TMP3:%.*]] = sext <4 x i32> [[TMP2]] to <4 x i64>
11+
; CHECK-NEXT: [[TMP4:%.*]] = sitofp <4 x i64> [[TMP3]] to <4 x float>
12+
; CHECK-NEXT: [[TMP5:%.*]] = sitofp <4 x i32> [[TMP2]] to <4 x float>
13+
; CHECK-NEXT: [[TMP6:%.*]] = fadd <4 x float> [[TMP4]], [[TMP5]]
14+
; CHECK-NEXT: [[TMP7:%.*]] = fcmp ogt <4 x float> [[TMP6]], zeroinitializer
15+
; CHECK-NEXT: ret <4 x float> [[TMP6]]
16+
;
17+
entry:
18+
%1 = trunc i64 0 to i32
19+
%2 = sitofp i32 %1 to float
20+
%3 = sitofp i64 0 to float
21+
%4 = fadd float %3, %2
22+
%to_max.i = fcmp ogt float %4, 0.000000e+00
23+
%5 = trunc i64 0 to i32
24+
%6 = sitofp i32 %5 to float
25+
%7 = sitofp i64 0 to float
26+
%8 = fadd float %7, %6
27+
%to_max.i.1 = fcmp ogt float %8, 0.000000e+00
28+
%9 = trunc i64 %0 to i32
29+
%10 = sitofp i32 %9 to float
30+
%11 = sitofp i64 %0 to float
31+
%12 = fadd float %11, %10
32+
%to_max.i.2 = fcmp ogt float %12, 0.000000e+00
33+
%13 = trunc i64 0 to i32
34+
%14 = sitofp i32 %13 to float
35+
%15 = sitofp i64 0 to float
36+
%16 = fadd float %15, %14
37+
%to_max.i.3 = fcmp ogt float %16, 0.000000e+00
38+
%r0 = insertelement <4 x float> poison, float %4, i32 0
39+
%r1 = insertelement <4 x float> %r0, float %8, i32 1
40+
%r2 = insertelement <4 x float> %r1, float %12, i32 2
41+
%r3 = insertelement <4 x float> %r2, float %16, i32 3
42+
ret <4 x float> %r3
43+
}

0 commit comments

Comments
 (0)