1; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s 2 3target 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" 4target triple = "x86_64-apple-macosx10.7.0" 5 6; int bar(double *A, int d) { 7; double A0 = A[0]; 8; double A1 = A[1]; 9; float F0 = A0; 10; float F1 = A1; 11; if (d) foo(); <----- This splits the blocks 12; F0+=4.0; 13; F1+=5.0; 14; A[8] = 9.0 + F0; 15; A[9] = 5.0 + F1; 16; } 17 18 19;CHECK-LABEL: @bar( 20;CHECK: load <2 x double> 21;CHECK: fptrunc <2 x double> 22;CHECK: call i32 23;CHECK: fadd <2 x float> 24;CHECK: fpext <2 x float> 25;CHECK: store <2 x double> 26;CHECK: ret 27define i32 @bar(double* nocapture %A, i32 %d) { 28 %1 = load double, double* %A, align 8 29 %2 = getelementptr inbounds double, double* %A, i64 1 30 %3 = load double, double* %2, align 8 31 %4 = fptrunc double %1 to float 32 %5 = fptrunc double %3 to float 33 %6 = icmp eq i32 %d, 0 34 br i1 %6, label %9, label %7 35 36; <label>:7 ; preds = %0 37 %8 = tail call i32 (...) @foo() 38 br label %9 39 40; <label>:9 ; preds = %0, %7 41 %10 = fadd float %4, 4.000000e+00 42 %11 = fadd float %5, 5.000000e+00 43 %12 = fpext float %10 to double 44 %13 = fadd double %12, 9.000000e+00 45 %14 = getelementptr inbounds double, double* %A, i64 8 46 store double %13, double* %14, align 8 47 %15 = fpext float %11 to double 48 %16 = fadd double %15, 5.000000e+00 49 %17 = getelementptr inbounds double, double* %A, i64 9 50 store double %16, double* %17, align 8 51 ret i32 undef 52} 53 54declare i32 @foo(...) 55 56