1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 2; RUN: opt < %s -basic-aa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s 3 4target 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" 5target triple = "x86_64-apple-macosx10.8.0" 6 7; At this point we can't vectorize only parts of the tree. 8 9define i32 @test(double* nocapture %A, i8* nocapture %B) { 10; CHECK-LABEL: @test( 11; CHECK-NEXT: entry: 12; CHECK-NEXT: [[TMP0:%.*]] = bitcast i8* [[B:%.*]] to <2 x i8>* 13; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i8>, <2 x i8>* [[TMP0]], align 1 14; CHECK-NEXT: [[TMP2:%.*]] = add <2 x i8> [[TMP1]], <i8 3, i8 3> 15; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i8> [[TMP2]], i32 1 16; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x i8> [[TMP2]], i32 0 17; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i8> undef, i8 [[TMP4]], i32 0 18; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i8> [[TMP5]], i8 [[TMP3]], i32 1 19; CHECK-NEXT: [[TMP7:%.*]] = sitofp <2 x i8> [[TMP6]] to <2 x double> 20; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x double> [[TMP7]], [[TMP7]] 21; CHECK-NEXT: [[TMP9:%.*]] = fadd <2 x double> [[TMP8]], <double 1.000000e+00, double 1.000000e+00> 22; CHECK-NEXT: [[TMP10:%.*]] = fmul <2 x double> [[TMP9]], [[TMP9]] 23; CHECK-NEXT: [[TMP11:%.*]] = fadd <2 x double> [[TMP10]], <double 1.000000e+00, double 1.000000e+00> 24; CHECK-NEXT: [[TMP12:%.*]] = fmul <2 x double> [[TMP11]], [[TMP11]] 25; CHECK-NEXT: [[TMP13:%.*]] = fadd <2 x double> [[TMP12]], <double 1.000000e+00, double 1.000000e+00> 26; CHECK-NEXT: [[TMP14:%.*]] = fmul <2 x double> [[TMP13]], [[TMP13]] 27; CHECK-NEXT: [[TMP15:%.*]] = fadd <2 x double> [[TMP14]], <double 1.000000e+00, double 1.000000e+00> 28; CHECK-NEXT: [[TMP16:%.*]] = fmul <2 x double> [[TMP15]], [[TMP15]] 29; CHECK-NEXT: [[TMP17:%.*]] = fadd <2 x double> [[TMP16]], <double 1.000000e+00, double 1.000000e+00> 30; CHECK-NEXT: [[TMP18:%.*]] = bitcast double* [[A:%.*]] to <2 x double>* 31; CHECK-NEXT: store <2 x double> [[TMP17]], <2 x double>* [[TMP18]], align 8 32; CHECK-NEXT: ret i32 undef 33; 34entry: 35 %0 = load i8, i8* %B, align 1 36 %arrayidx1 = getelementptr inbounds i8, i8* %B, i64 1 37 %1 = load i8, i8* %arrayidx1, align 1 38 %add = add i8 %0, 3 39 %add4 = add i8 %1, 3 40 %conv6 = sitofp i8 %add to double 41 %conv7 = sitofp i8 %add4 to double 42 %mul = fmul double %conv6, %conv6 43 %add8 = fadd double %mul, 1.000000e+00 44 %mul9 = fmul double %conv7, %conv7 45 %add10 = fadd double %mul9, 1.000000e+00 46 %mul11 = fmul double %add8, %add8 47 %add12 = fadd double %mul11, 1.000000e+00 48 %mul13 = fmul double %add10, %add10 49 %add14 = fadd double %mul13, 1.000000e+00 50 %mul15 = fmul double %add12, %add12 51 %add16 = fadd double %mul15, 1.000000e+00 52 %mul17 = fmul double %add14, %add14 53 %add18 = fadd double %mul17, 1.000000e+00 54 %mul19 = fmul double %add16, %add16 55 %add20 = fadd double %mul19, 1.000000e+00 56 %mul21 = fmul double %add18, %add18 57 %add22 = fadd double %mul21, 1.000000e+00 58 %mul23 = fmul double %add20, %add20 59 %add24 = fadd double %mul23, 1.000000e+00 60 %mul25 = fmul double %add22, %add22 61 %add26 = fadd double %mul25, 1.000000e+00 62 store double %add24, double* %A, align 8 63 %arrayidx28 = getelementptr inbounds double, double* %A, i64 1 64 store double %add26, double* %arrayidx28, align 8 65 ret i32 undef 66} 67