1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S -mcpu=cascadelake -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
7 ; CHECK-NEXT: [[CONV:%.*]] = uitofp i16 undef to float
8 ; CHECK-NEXT: [[SUB:%.*]] = fsub float 6.553500e+04, undef
9 ; CHECK-NEXT: br label [[BB1:%.*]]
11 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> <float poison, float poison, float undef, float undef>, float [[SUB]], i32 0
12 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[CONV]], i32 1
13 ; CHECK-NEXT: br label [[BB2:%.*]]
15 ; CHECK-NEXT: [[TMP2:%.*]] = phi <4 x float> [ [[TMP1]], [[BB1]] ], [ [[TMP10:%.*]], [[BB3:%.*]] ]
16 ; CHECK-NEXT: [[TMP3:%.*]] = load double, ptr undef, align 8
17 ; CHECK-NEXT: br i1 undef, label [[BB3]], label [[BB4:%.*]]
19 ; CHECK-NEXT: [[TMP4:%.*]] = fpext <4 x float> [[TMP2]] to <4 x double>
20 ; CHECK-NEXT: [[CONV2:%.*]] = uitofp i16 undef to double
21 ; CHECK-NEXT: [[ADD1:%.*]] = fadd double [[TMP3]], [[CONV2]]
22 ; CHECK-NEXT: [[SUB1:%.*]] = fsub double undef, undef
23 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x double> <double poison, double poison, double undef, double undef>, double [[SUB1]], i32 0
24 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x double> [[TMP5]], double [[ADD1]], i32 1
25 ; CHECK-NEXT: [[TMP7:%.*]] = fcmp ogt <4 x double> [[TMP6]], [[TMP4]]
26 ; CHECK-NEXT: [[TMP8:%.*]] = fptrunc <4 x double> [[TMP6]] to <4 x float>
27 ; CHECK-NEXT: [[TMP9:%.*]] = select <4 x i1> [[TMP7]], <4 x float> [[TMP2]], <4 x float> [[TMP8]]
28 ; CHECK-NEXT: br label [[BB3]]
30 ; CHECK-NEXT: [[TMP10]] = phi <4 x float> [ [[TMP9]], [[BB4]] ], [ [[TMP2]], [[BB2]] ]
31 ; CHECK-NEXT: br label [[BB2]]
34 %conv = uitofp i16 undef to float
35 %sub = fsub float 6.553500e+04, undef
42 %0 = phi float [ %sub, %bb1 ], [ %9, %bb3 ]
43 %1 = phi float [ %conv, %bb1 ], [ %10, %bb3 ]
44 %2 = phi float [ undef, %bb1 ], [ %11, %bb3 ]
45 %3 = phi float [ undef, %bb1 ], [ %12, %bb3 ]
46 %4 = load double, ptr undef, align 8
47 br i1 undef, label %bb3, label %bb4
50 %ext = fpext float %3 to double
51 %cmp1 = fcmp ogt double undef, %ext
52 %5 = fptrunc double undef to float
53 %sel1 = select i1 %cmp1, float %3, float %5
54 %ext2 = fpext float %2 to double
55 %cmp2 = fcmp ogt double undef, %ext2
56 %6 = fptrunc double undef to float
57 %sel2 = select i1 %cmp2, float %2, float %6
58 %ext3 = fpext float %1 to double
59 %conv2 = uitofp i16 undef to double
60 %add1 = fadd double %4, %conv2
61 %cmp3 = fcmp ogt double %add1, %ext3
62 %7 = fptrunc double %add1 to float
63 %sel3 = select i1 %cmp3, float %1, float %7
64 %ext4 = fpext float %0 to double
65 %sub1 = fsub double undef, undef
66 %cmp4 = fcmp ogt double %sub1, %ext4
67 %8 = fptrunc double %sub1 to float
68 %sel4 = select i1 %cmp4, float %0, float %8
72 %9 = phi float [ %sel4, %bb4 ], [ %0, %bb2 ]
73 %10 = phi float [ %sel3, %bb4 ], [ %1, %bb2 ]
74 %11 = phi float [ %sel2, %bb4 ], [ %2, %bb2 ]
75 %12 = phi float [ %sel1, %bb4 ], [ %3, %bb2 ]