1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux -mattr=+sse4.2 | FileCheck %s
4 @a = common local_unnamed_addr global [4 x i32] zeroinitializer, align 4
5 @b = common local_unnamed_addr global [4 x i32] zeroinitializer, align 4
10 ; CHECK-NEXT: [[TMP0:%.*]] = load <4 x i32>, ptr @b, align 4
11 ; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt <4 x i32> [[TMP0]], zeroinitializer
12 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[TMP0]], <4 x i32> <i32 8, i32 poison, i32 ptrtoint (ptr @fn1 to i32), i32 poison>, <4 x i32> <i32 4, i32 1, i32 6, i32 6>
13 ; CHECK-NEXT: [[TMP3:%.*]] = select <4 x i1> [[TMP1]], <4 x i32> [[TMP2]], <4 x i32> <i32 0, i32 6, i32 0, i32 0>
14 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x i32> [[TMP3]], <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
15 ; CHECK-NEXT: store <4 x i32> [[TMP4]], ptr @a, align 4
16 ; CHECK-NEXT: ret i32 0
19 %0 = load i32, ptr @b, align 4
20 %cmp = icmp sgt i32 %0, 0
21 %cond = select i1 %cmp, i32 8, i32 0
22 store i32 %cond, ptr getelementptr inbounds ([4 x i32], ptr @a, i64 0, i32 3), align 4
23 %1 = load i32, ptr getelementptr ([4 x i32], ptr @b, i64 0, i32 1), align 4
24 %cmp1 = icmp sgt i32 %1, 0
25 %. = select i1 %cmp1, i32 %1, i32 6
26 store i32 %., ptr @a, align 4
27 %2 = load i32, ptr getelementptr ([4 x i32], ptr @b, i64 0, i32 2), align 4
28 %cmp4 = icmp sgt i32 %2, 0
29 %3 = select i1 %cmp4, i32 ptrtoint (ptr @fn1 to i32), i32 0
30 store i32 %3, ptr getelementptr inbounds ([4 x i32], ptr @a, i64 0, i32 1), align 4
31 %4 = load i32, ptr getelementptr ([4 x i32], ptr @b, i64 0, i32 3), align 4
32 %cmp6 = icmp sgt i32 %4, 0
33 %5 = select i1 %cmp6, i32 ptrtoint (ptr @fn1 to i32), i32 0
34 store i32 %5, ptr getelementptr inbounds ([4 x i32], ptr @a, i64 0, i32 2), align 4