1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-pc-windows-msvc19.34.0 < %s | FileCheck %s
4 define void @test(ptr %0, i8 %1, i1 %cmp12.i) {
5 ; CHECK-LABEL: define void @test(
6 ; CHECK-SAME: ptr [[TMP0:%.*]], i8 [[TMP1:%.*]], i1 [[CMP12_I:%.*]]) {
8 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <8 x i1> poison, i1 [[CMP12_I]], i32 0
9 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x i1> [[TMP2]], <8 x i1> poison, <8 x i32> zeroinitializer
10 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <8 x i8> poison, i8 [[TMP1]], i32 0
11 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <8 x i8> [[TMP4]], <8 x i8> poison, <8 x i32> zeroinitializer
12 ; CHECK-NEXT: br label [[PRE:%.*]]
14 ; CHECK-NEXT: [[TMP8:%.*]] = call <8 x i8> @llvm.umax.v8i8(<8 x i8> [[TMP5]], <8 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>)
15 ; CHECK-NEXT: [[TMP9:%.*]] = add <8 x i8> [[TMP8]], <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
16 ; CHECK-NEXT: [[TMP10:%.*]] = select <8 x i1> [[TMP3]], <8 x i8> [[TMP9]], <8 x i8> [[TMP5]]
17 ; CHECK-NEXT: store <8 x i8> [[TMP10]], ptr [[TMP0]], align 1
18 ; CHECK-NEXT: br label [[PRE]]
21 %idx11 = getelementptr i8, ptr %0, i64 1
22 %idx22 = getelementptr i8, ptr %0, i64 2
23 %idx33 = getelementptr i8, ptr %0, i64 3
24 %idx44 = getelementptr i8, ptr %0, i64 4
25 %idx55 = getelementptr i8, ptr %0, i64 5
26 %idx66 = getelementptr i8, ptr %0, i64 6
27 %idx77 = getelementptr i8, ptr %0, i64 7
31 %conv.i = zext i8 %1 to i32
32 %2 = tail call i32 @llvm.umax.i32(i32 %conv.i, i32 1)
33 %.sroa.speculated.i = add i32 %2, 1
34 %intensity.0.i = select i1 %cmp12.i, i32 %.sroa.speculated.i, i32 %conv.i
35 %conv14.i = trunc i32 %intensity.0.i to i8
36 store i8 %conv14.i, ptr %0, align 1
37 %conv.i.1 = zext i8 %1 to i32
38 %3 = tail call i32 @llvm.umax.i32(i32 %conv.i.1, i32 1)
40 %ii1 = select i1 %cmp12.i, i32 %ss1, i32 %conv.i.1
41 %conv14.i.1 = trunc i32 %ii1 to i8
42 store i8 %conv14.i.1, ptr %idx11, align 1
43 %conv.i.2 = zext i8 %1 to i32
44 %4 = tail call i32 @llvm.umax.i32(i32 %conv.i.2, i32 1)
46 %ii2 = select i1 %cmp12.i, i32 %ss2, i32 %conv.i.2
47 %conv14.i.2 = trunc i32 %ii2 to i8
48 store i8 %conv14.i.2, ptr %idx22, align 1
49 %conv.i.3 = zext i8 %1 to i32
50 %5 = tail call i32 @llvm.umax.i32(i32 %conv.i.3, i32 1)
52 %ii3 = select i1 %cmp12.i, i32 %ss3, i32 %conv.i.3
53 %conv14.i.3 = trunc i32 %ii3 to i8
54 store i8 %conv14.i.3, ptr %idx33, align 1
55 %conv.i.4 = zext i8 %1 to i32
56 %6 = tail call i32 @llvm.umax.i32(i32 %conv.i.4, i32 1)
58 %ii4 = select i1 %cmp12.i, i32 %ss4, i32 %conv.i.4
59 %conv14.i.4 = trunc i32 %ii4 to i8
60 store i8 %conv14.i.4, ptr %idx44, align 1
61 %conv.i.5 = zext i8 %1 to i32
62 %7 = tail call i32 @llvm.umax.i32(i32 %conv.i.5, i32 1)
64 %ii5 = select i1 %cmp12.i, i32 %ss5, i32 %conv.i.5
65 %conv14.i.5 = trunc i32 %ii5 to i8
66 store i8 %conv14.i.5, ptr %idx55, align 1
67 %conv.i.6 = zext i8 %1 to i32
68 %8 = tail call i32 @llvm.umax.i32(i32 %conv.i.6, i32 1)
70 %ii6 = select i1 %cmp12.i, i32 %ss6, i32 %conv.i.6
71 %conv14.i.6 = trunc i32 %ii6 to i8
72 store i8 %conv14.i.6, ptr %idx66, align 1
73 %conv.i.7 = zext i8 %1 to i32
74 %9 = tail call i32 @llvm.umax.i32(i32 %conv.i.7, i32 1)
76 %ii7 = select i1 %cmp12.i, i32 %ss7, i32 %conv.i.7
77 %conv14.i.7 = trunc i32 %ii7 to i8
78 store i8 %conv14.i.7, ptr %idx77, align 1