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-unknown-linux < %s | FileCheck %s
4 define i64 @test(ptr %p) {
5 ; CHECK-LABEL: define i64 @test(
6 ; CHECK-SAME: ptr [[P:%.*]]) {
7 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[P]], i64 12
8 ; CHECK-NEXT: [[TMP2:%.*]] = xor <4 x i32> zeroinitializer, zeroinitializer
9 ; CHECK-NEXT: [[TMP3:%.*]] = xor <4 x i32> [[TMP2]], zeroinitializer
10 ; CHECK-NEXT: [[TMP4:%.*]] = xor <4 x i32> [[TMP3]], zeroinitializer
11 ; CHECK-NEXT: [[TMP5:%.*]] = xor <4 x i32> [[TMP4]], zeroinitializer
12 ; CHECK-NEXT: [[TMP6:%.*]] = xor <4 x i32> [[TMP5]], zeroinitializer
13 ; CHECK-NEXT: [[TMP7:%.*]] = xor <4 x i32> [[TMP6]], zeroinitializer
14 ; CHECK-NEXT: [[TMP8:%.*]] = xor <4 x i32> [[TMP7]], zeroinitializer
15 ; CHECK-NEXT: [[TMP9:%.*]] = xor <4 x i32> [[TMP8]], zeroinitializer
16 ; CHECK-NEXT: [[TMP10:%.*]] = xor <4 x i32> [[TMP9]], zeroinitializer
17 ; CHECK-NEXT: [[TMP11:%.*]] = xor <4 x i32> [[TMP10]], zeroinitializer
18 ; CHECK-NEXT: [[TMP12:%.*]] = trunc <4 x i32> [[TMP11]] to <4 x i8>
19 ; CHECK-NEXT: store <4 x i8> [[TMP12]], ptr [[TMP1]], align 1
20 ; CHECK-NEXT: ret i64 0
22 %1 = getelementptr i8, ptr %p, i64 13
23 %2 = getelementptr i8, ptr %p, i64 14
24 %3 = getelementptr i8, ptr %p, i64 15
25 %4 = getelementptr i8, ptr %p, i64 12
28 %.not866 = icmp eq i32 %6, 0
29 %7 = select i1 %.not866, i32 0, i32 0
33 %.not871 = icmp eq i32 %10, 0
34 %11 = select i1 %.not871, i32 0, i32 0
41 %18 = xor i32 %17, %12
46 %23 = trunc i32 %22 to i8
47 store i8 %23, ptr %4, align 1
58 %34 = trunc i32 %33 to i8
59 store i8 %34, ptr %1, align 1
70 %45 = trunc i32 %44 to i8
71 store i8 %45, ptr %2, align 1
81 %55 = trunc i32 %54 to i8
82 store i8 %55, ptr %3, align 1
86 define i64 @test1(ptr %p) {
87 ; CHECK-LABEL: define i64 @test1(
88 ; CHECK-SAME: ptr [[P:%.*]]) {
89 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr [[P]], i64 12
90 ; CHECK-NEXT: [[TMP2:%.*]] = xor <4 x i32> zeroinitializer, zeroinitializer
91 ; CHECK-NEXT: [[TMP3:%.*]] = xor <4 x i32> [[TMP2]], zeroinitializer
92 ; CHECK-NEXT: [[TMP4:%.*]] = xor <4 x i32> [[TMP3]], zeroinitializer
93 ; CHECK-NEXT: [[TMP5:%.*]] = xor <4 x i32> [[TMP4]], zeroinitializer
94 ; CHECK-NEXT: [[TMP6:%.*]] = xor <4 x i32> [[TMP5]], zeroinitializer
95 ; CHECK-NEXT: [[TMP7:%.*]] = xor <4 x i32> [[TMP6]], zeroinitializer
96 ; CHECK-NEXT: [[TMP8:%.*]] = xor <4 x i32> [[TMP7]], zeroinitializer
97 ; CHECK-NEXT: [[TMP9:%.*]] = xor <4 x i32> [[TMP8]], zeroinitializer
98 ; CHECK-NEXT: [[TMP10:%.*]] = xor <4 x i32> [[TMP9]], zeroinitializer
99 ; CHECK-NEXT: [[TMP11:%.*]] = xor <4 x i32> [[TMP10]], zeroinitializer
100 ; CHECK-NEXT: [[TMP12:%.*]] = trunc <4 x i32> [[TMP11]] to <4 x i8>
101 ; CHECK-NEXT: store <4 x i8> [[TMP12]], ptr [[TMP1]], align 1
102 ; CHECK-NEXT: ret i64 0
104 %1 = getelementptr i8, ptr %p, i64 13
105 %2 = getelementptr i8, ptr %p, i64 14
106 %3 = getelementptr i8, ptr %p, i64 15
107 %4 = getelementptr i8, ptr %p, i64 12
108 %5 = zext i8 0 to i32
110 %.not866 = icmp eq i32 %6, 0
111 %7 = select i1 %.not866, i32 0, i32 0
113 %9 = zext i8 0 to i32
115 %.not869 = icmp eq i32 %10, 0
116 %11 = select i1 %.not869, i32 0, i32 0
118 %13 = zext i8 0 to i32
120 %.not871 = icmp eq i32 %14, 0
121 %15 = select i1 %.not871, i32 0, i32 0
123 %17 = zext i8 0 to i32
125 %.not874 = icmp eq i32 %18, 0
126 %19 = select i1 %.not874, i32 0, i32 0
134 %27 = xor i32 %26, %8
138 %31 = trunc i32 %30 to i8
139 store i8 %31, ptr %4, align 1
146 %38 = xor i32 %37, %20
150 %42 = trunc i32 %41 to i8
151 store i8 %42, ptr %1, align 1
158 %49 = xor i32 %48, %16
162 %53 = trunc i32 %52 to i8
163 store i8 %53, ptr %2, align 1
169 %59 = xor i32 %58, %12
173 %63 = trunc i32 %62 to i8
174 store i8 %63, ptr %3, align 1