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-gnu -mcpu=skylake-avx512 | FileCheck %s
6 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, ptr undef, i64 4
7 ; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds [4 x [4 x i32]], ptr undef, i64 0, i64 1, i64 0
8 ; CHECK-NEXT: [[TMP4:%.*]] = load <4 x i8>, ptr [[TMP1]], align 1
9 ; CHECK-NEXT: [[TMP5:%.*]] = zext <4 x i8> [[TMP4]] to <4 x i32>
10 ; CHECK-NEXT: [[TMP6:%.*]] = sub nsw <4 x i32> zeroinitializer, [[TMP5]]
11 ; CHECK-NEXT: [[TMP7:%.*]] = shl nsw <4 x i32> [[TMP6]], zeroinitializer
12 ; CHECK-NEXT: [[TMP8:%.*]] = add nsw <4 x i32> [[TMP7]], zeroinitializer
13 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x i32> [[TMP8]], <4 x i32> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
14 ; CHECK-NEXT: [[TMP10:%.*]] = add nsw <4 x i32> [[TMP8]], [[TMP9]]
15 ; CHECK-NEXT: [[TMP11:%.*]] = sub nsw <4 x i32> [[TMP8]], [[TMP9]]
16 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <4 x i32> [[TMP10]], <4 x i32> [[TMP11]], <4 x i32> <i32 1, i32 4, i32 3, i32 6>
17 ; CHECK-NEXT: [[TMP13:%.*]] = add nsw <4 x i32> zeroinitializer, [[TMP12]]
18 ; CHECK-NEXT: [[TMP14:%.*]] = sub nsw <4 x i32> zeroinitializer, [[TMP12]]
19 ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <4 x i32> [[TMP13]], <4 x i32> [[TMP14]], <4 x i32> <i32 0, i32 1, i32 6, i32 7>
20 ; CHECK-NEXT: store <4 x i32> [[TMP15]], ptr [[TMP2]], align 16
21 ; CHECK-NEXT: ret void
23 %1 = getelementptr inbounds i8, ptr undef, i64 4
24 %2 = load i8, ptr %1, align 1
25 %3 = zext i8 %2 to i32
26 %4 = sub nsw i32 0, %3
27 %5 = shl nsw i32 %4, 0
28 %6 = add nsw i32 %5, 0
29 %7 = getelementptr inbounds i8, ptr undef, i64 5
30 %8 = load i8, ptr %7, align 1
31 %9 = zext i8 %8 to i32
32 %10 = sub nsw i32 0, %9
33 %11 = shl nsw i32 %10, 0
34 %12 = add nsw i32 %11, 0
35 %13 = getelementptr inbounds i8, ptr undef, i64 6
36 %14 = load i8, ptr %13, align 1
37 %15 = zext i8 %14 to i32
38 %16 = sub nsw i32 0, %15
39 %17 = shl nsw i32 %16, 0
40 %18 = add nsw i32 %17, 0
41 %19 = getelementptr inbounds i8, ptr undef, i64 7
42 %20 = load i8, ptr %19, align 1
43 %21 = zext i8 %20 to i32
44 %22 = sub nsw i32 0, %21
45 %23 = shl nsw i32 %22, 0
46 %24 = add nsw i32 %23, 0
47 %25 = add nsw i32 %12, %6
48 %26 = sub nsw i32 %6, %12
49 %27 = add nsw i32 %24, %18
50 %28 = sub nsw i32 %18, %24
51 %29 = add nsw i32 0, %25
52 %30 = getelementptr inbounds [4 x [4 x i32]], ptr undef, i64 0, i64 1, i64 0
53 store i32 %29, ptr %30, align 16
54 %31 = sub nsw i32 0, %27
55 %32 = getelementptr inbounds [4 x [4 x i32]], ptr undef, i64 0, i64 1, i64 2
56 store i32 %31, ptr %32, align 8
57 %33 = add nsw i32 0, %26
58 %34 = getelementptr inbounds [4 x [4 x i32]], ptr undef, i64 0, i64 1, i64 1
59 store i32 %33, ptr %34, align 4
60 %35 = sub nsw i32 0, %28
61 %36 = getelementptr inbounds [4 x [4 x i32]], ptr undef, i64 0, i64 1, i64 3
62 store i32 %35, ptr %36, align 4