1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer,dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.8.0"
7 ; At this point we can't vectorize only parts of the tree.
9 define i32 @test(ptr nocapture %A, ptr nocapture %B) {
12 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i8>, ptr [[B:%.*]], align 1
13 ; CHECK-NEXT: [[TMP2:%.*]] = add <2 x i8> [[TMP1]], <i8 3, i8 3>
14 ; CHECK-NEXT: [[TMP3:%.*]] = sitofp <2 x i8> [[TMP2]] to <2 x double>
15 ; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[TMP3]], [[TMP3]]
16 ; CHECK-NEXT: [[TMP5:%.*]] = fadd <2 x double> [[TMP4]], <double 1.000000e+00, double 1.000000e+00>
17 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[TMP5]], [[TMP5]]
18 ; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x double> [[TMP6]], <double 1.000000e+00, double 1.000000e+00>
19 ; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x double> [[TMP7]], [[TMP7]]
20 ; CHECK-NEXT: [[TMP9:%.*]] = fadd <2 x double> [[TMP8]], <double 1.000000e+00, double 1.000000e+00>
21 ; CHECK-NEXT: [[TMP10:%.*]] = fmul <2 x double> [[TMP9]], [[TMP9]]
22 ; CHECK-NEXT: [[TMP11:%.*]] = fadd <2 x double> [[TMP10]], <double 1.000000e+00, double 1.000000e+00>
23 ; CHECK-NEXT: [[TMP12:%.*]] = fmul <2 x double> [[TMP11]], [[TMP11]]
24 ; CHECK-NEXT: [[TMP13:%.*]] = fadd <2 x double> [[TMP12]], <double 1.000000e+00, double 1.000000e+00>
25 ; CHECK-NEXT: store <2 x double> [[TMP13]], ptr [[A:%.*]], align 8
26 ; CHECK-NEXT: ret i32 undef
29 %0 = load i8, ptr %B, align 1
30 %arrayidx1 = getelementptr inbounds i8, ptr %B, i64 1
31 %1 = load i8, ptr %arrayidx1, align 1
34 %conv6 = sitofp i8 %add to double
35 %conv7 = sitofp i8 %add4 to double
36 %mul = fmul double %conv6, %conv6
37 %add8 = fadd double %mul, 1.000000e+00
38 %mul9 = fmul double %conv7, %conv7
39 %add10 = fadd double %mul9, 1.000000e+00
40 %mul11 = fmul double %add8, %add8
41 %add12 = fadd double %mul11, 1.000000e+00
42 %mul13 = fmul double %add10, %add10
43 %add14 = fadd double %mul13, 1.000000e+00
44 %mul15 = fmul double %add12, %add12
45 %add16 = fadd double %mul15, 1.000000e+00
46 %mul17 = fmul double %add14, %add14
47 %add18 = fadd double %mul17, 1.000000e+00
48 %mul19 = fmul double %add16, %add16
49 %add20 = fadd double %mul19, 1.000000e+00
50 %mul21 = fmul double %add18, %add18
51 %add22 = fadd double %mul21, 1.000000e+00
52 %mul23 = fmul double %add20, %add20
53 %add24 = fadd double %mul23, 1.000000e+00
54 %mul25 = fmul double %add22, %add22
55 %add26 = fadd double %mul25, 1.000000e+00
56 store double %add24, ptr %A, align 8
57 %arrayidx28 = getelementptr inbounds double, ptr %A, i64 1
58 store double %add26, ptr %arrayidx28, align 8