1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 define void @foo(ptr %c, ptr %d) {
7 ; CHECK-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds i8, ptr [[C:%.*]], i64 1
8 ; CHECK-NEXT: [[ADD_PTR53:%.*]] = getelementptr inbounds float, ptr [[D:%.*]], i64 -4
9 ; CHECK-NEXT: [[TMP1:%.*]] = load <4 x i8>, ptr [[ARRAYIDX4]], align 1
10 ; CHECK-NEXT: [[TMP2:%.*]] = zext <4 x i8> [[TMP1]] to <4 x i32>
11 ; CHECK-NEXT: [[TMP3:%.*]] = shl nuw nsw <4 x i32> [[TMP2]], <i32 2, i32 2, i32 2, i32 3>
12 ; CHECK-NEXT: [[TMP4:%.*]] = and <4 x i32> [[TMP2]], <i32 2, i32 2, i32 2, i32 3>
13 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP3]], <4 x i32> [[TMP4]], <4 x i32> <i32 1, i32 2, i32 7, i32 0>
14 ; CHECK-NEXT: [[TMP6:%.*]] = add nsw <4 x i32> undef, [[TMP5]]
15 ; CHECK-NEXT: [[TMP7:%.*]] = sitofp <4 x i32> [[TMP6]] to <4 x float>
16 ; CHECK-NEXT: [[TMP8:%.*]] = fdiv <4 x float> [[TMP7]], undef
17 ; CHECK-NEXT: store <4 x float> [[TMP8]], ptr [[ADD_PTR53]], align 4
18 ; CHECK-NEXT: ret void
21 %arrayidx1 = getelementptr inbounds i8, ptr %c, i64 4
22 %0 = load i8, ptr %arrayidx1, align 1
23 %conv2 = zext i8 %0 to i32
24 %and = and i32 %conv2, 3
25 %arrayidx4 = getelementptr inbounds i8, ptr %c, i64 1
26 %1 = load i8, ptr %arrayidx4, align 1
27 %conv5 = zext i8 %1 to i32
28 %shl6 = shl nuw nsw i32 %conv5, 2
29 %arrayidx12 = getelementptr inbounds i8, ptr %c, i64 2
30 %2 = load i8, ptr %arrayidx12, align 1
31 %conv13 = zext i8 %2 to i32
32 %shl14 = shl nuw nsw i32 %conv13, 2
33 %arrayidx17 = getelementptr inbounds i8, ptr %c, i64 3
34 %3 = load i8, ptr %arrayidx17, align 1
35 %conv18 = zext i8 %3 to i32
36 %shl19 = shl nuw nsw i32 %conv18, 2
37 %sub = add nsw i32 undef, %shl6
38 %conv27 = sitofp i32 %sub to float
39 %div = fdiv float %conv27, undef
40 %add.ptr = getelementptr inbounds float, ptr %d, i64 -1
41 store float %div, ptr %add.ptr, align 4
42 %sub32 = add nsw i32 undef, %and
43 %conv33 = sitofp i32 %sub32 to float
44 %div36 = fdiv float %conv33, undef
45 %add.ptr37 = getelementptr inbounds float, ptr %d, i64 -2
46 store float %div36, ptr %add.ptr37, align 4
47 %sub40 = add nsw i32 undef, %shl19
48 %conv41 = sitofp i32 %sub40 to float
49 %div44 = fdiv float %conv41, undef
50 %add.ptr45 = getelementptr inbounds float, ptr %d, i64 -3
51 store float %div44, ptr %add.ptr45, align 4
52 %sub48 = add nsw i32 undef, %shl14
53 %conv49 = sitofp i32 %sub48 to float
54 %div52 = fdiv float %conv49, undef
55 %add.ptr53 = getelementptr inbounds float, ptr %d, i64 -4
56 store float %div52, ptr %add.ptr53, align 4