; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -passes=slp-vectorizer -S -slp-revec %s | FileCheck %s @b = external dso_local local_unnamed_addr global i64, align 8 @d = external dso_local local_unnamed_addr global i32, align 4 @c = external dso_local local_unnamed_addr global i32, align 4 @a = external dso_local local_unnamed_addr global i8, align 2 define void @e() { ; CHECK-LABEL: @e( ; CHECK-NEXT: vector.ph: ; CHECK-NEXT: [[C_PROMOTED5:%.*]] = load i32, ptr @c, align 4 ; CHECK-NEXT: [[A_PROMOTED7:%.*]] = load i8, ptr @a, align 2 ; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <16 x i32> poison, i32 [[C_PROMOTED5]], i64 0 ; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <16 x i32> [[DOTSPLATINSERT]], <16 x i32> poison, <16 x i32> zeroinitializer ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <16 x i8> , i8 [[A_PROMOTED7]], i64 0 ; CHECK-NEXT: [[TMP1:%.*]] = add <16 x i32> [[DOTSPLAT]], ; CHECK-NEXT: [[TMP2:%.*]] = add <16 x i32> [[DOTSPLAT]], ; CHECK-NEXT: [[TMP3:%.*]] = add <16 x i32> [[DOTSPLAT]], ; CHECK-NEXT: [[INDUCTION:%.*]] = add <16 x i32> [[DOTSPLAT]], ; CHECK-NEXT: [[TMP4:%.*]] = icmp ult <16 x i32> [[TMP1]], splat (i32 2) ; CHECK-NEXT: [[TMP5:%.*]] = icmp ult <16 x i32> [[TMP2]], splat (i32 2) ; CHECK-NEXT: [[TMP6:%.*]] = icmp ult <16 x i32> [[TMP3]], splat (i32 2) ; CHECK-NEXT: [[TMP7:%.*]] = icmp ult <16 x i32> [[INDUCTION]], splat (i32 2) ; CHECK-NEXT: [[TMP8:%.*]] = icmp eq <16 x i32> [[DOTSPLAT]], ; CHECK-NEXT: [[TMP9:%.*]] = or <16 x i1> [[TMP4]], [[TMP5]] ; CHECK-NEXT: [[TMP10:%.*]] = or <16 x i1> [[TMP9]], [[TMP6]] ; CHECK-NEXT: [[TMP11:%.*]] = or <16 x i1> [[TMP10]], [[TMP7]] ; CHECK-NEXT: [[TMP12:%.*]] = or <16 x i1> [[TMP11]], [[TMP8]] ; CHECK-NEXT: [[TMP13:%.*]] = zext <16 x i1> [[TMP12]] to <16 x i8> ; CHECK-NEXT: [[TMP14:%.*]] = or <16 x i8> [[TMP0]], [[TMP13]] ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <16 x i8> [[TMP14]], <16 x i8> , <16 x i32> ; CHECK-NEXT: [[TMP16:%.*]] = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> [[TMP15]]) ; CHECK-NEXT: [[TMP17:%.*]] = add i32 [[C_PROMOTED5]], 81 ; CHECK-NEXT: store i64 -1, ptr @b, align 8 ; CHECK-NEXT: store i32 9, ptr @d, align 4 ; CHECK-NEXT: store i32 [[TMP17]], ptr @c, align 4 ; CHECK-NEXT: store i8 [[TMP16]], ptr @a, align 2 ; CHECK-NEXT: ret void ; vector.ph: %c.promoted5 = load i32, ptr @c, align 4 %a.promoted7 = load i8, ptr @a, align 2 %.splatinsert = insertelement <16 x i32> poison, i32 %c.promoted5, i64 0 %.splat = shufflevector <16 x i32> %.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer %0 = insertelement <16 x i8> , i8 %a.promoted7, i64 0 %1 = add <16 x i32> %.splat, %2 = add <16 x i32> %.splat, %3 = add <16 x i32> %.splat, %induction = add <16 x i32> %.splat, %4 = icmp ult <16 x i32> %1, %5 = icmp ult <16 x i32> %2, %6 = icmp ult <16 x i32> %3, %7 = icmp ult <16 x i32> %induction, %8 = icmp eq <16 x i32> %.splat, %9 = or <16 x i1> %4, %5 %10 = or <16 x i1> %9, %6 %11 = or <16 x i1> %10, %7 %12 = or <16 x i1> %11, %8 %13 = zext <16 x i1> %12 to <16 x i8> %14 = or <16 x i8> %0, %13 %15 = shufflevector <16 x i8> %14, <16 x i8> , <16 x i32> %16 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> %15) %17 = add i32 %c.promoted5, 81 store i64 -1, ptr @b, align 8 store i32 9, ptr @d, align 4 store i32 %17, ptr @c, align 4 store i8 %16, ptr @a, align 2 ret void }