1 ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
3 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"
4 target triple = "x86_64-apple-macosx10.8.0"
6 ; int foo(double *A, float *B, int g) {
8 ; float B1 = B[1]; <----- BasicBlock #1
14 ; A[0] += B0; <------- BasicBlock #3
20 ;CHECK: load <2 x float>
21 ;CHECK: fadd <2 x float>
23 ;CHECK: load <2 x double>
24 ;CHECK: fadd <2 x double>
25 ;CHECK: store <2 x double>
27 define i32 @foo(double* nocapture %A, float* nocapture %B, i32 %g) {
29 %0 = load float* %B, align 4
30 %arrayidx1 = getelementptr inbounds float, float* %B, i64 1
31 %1 = load float* %arrayidx1, align 4
32 %add = fadd float %0, 5.000000e+00
33 %add2 = fadd float %1, 8.000000e+00
34 %tobool = icmp eq i32 %g, 0
35 br i1 %tobool, label %if.end, label %if.then
38 %call = tail call i32 (...)* @bar()
42 %conv = fpext float %add to double
43 %2 = load double* %A, align 8
44 %add4 = fadd double %conv, %2
45 store double %add4, double* %A, align 8
46 %conv5 = fpext float %add2 to double
47 %arrayidx6 = getelementptr inbounds double, double* %A, i64 1
48 %3 = load double* %arrayidx6, align 8
49 %add7 = fadd double %conv5, %3
50 store double %add7, double* %arrayidx6, align 8