Home | History | Annotate | Download | only in X86
      1 ; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
      2 
      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"
      5 
      6 ;int foo(char * restrict A, float * restrict B, float T) {
      7 ;  A[0] = (T * B[10] + 4.0);
      8 ;  A[1] = (T * B[11] + 5.0);
      9 ;  A[2] = (T * B[12] + 6.0);
     10 ;}
     11 
     12 ;CHECK-LABEL: @foo(
     13 ;CHECK-NOT: load <3 x float>
     14 ;CHECK-NOT: fmul <3 x float>
     15 ;CHECK-NOT: fpext <3 x float>
     16 ;CHECK-NOT: fadd <3 x double>
     17 ;CHECK-NOT: fptosi <3 x double>
     18 ;CHECK-NOT: store <3 x i8>
     19 ;CHECK: ret
     20 define i32 @foo(i8* noalias nocapture %A, float* noalias nocapture %B, float %T) {
     21   %1 = getelementptr inbounds float, float* %B, i64 10
     22   %2 = load float, float* %1, align 4
     23   %3 = fmul float %2, %T
     24   %4 = fpext float %3 to double
     25   %5 = fadd double %4, 4.000000e+00
     26   %6 = fptosi double %5 to i8
     27   store i8 %6, i8* %A, align 1
     28   %7 = getelementptr inbounds float, float* %B, i64 11
     29   %8 = load float, float* %7, align 4
     30   %9 = fmul float %8, %T
     31   %10 = fpext float %9 to double
     32   %11 = fadd double %10, 5.000000e+00
     33   %12 = fptosi double %11 to i8
     34   %13 = getelementptr inbounds i8, i8* %A, i64 1
     35   store i8 %12, i8* %13, align 1
     36   %14 = getelementptr inbounds float, float* %B, i64 12
     37   %15 = load float, float* %14, align 4
     38   %16 = fmul float %15, %T
     39   %17 = fpext float %16 to double
     40   %18 = fadd double %17, 6.000000e+00
     41   %19 = fptosi double %18 to i8
     42   %20 = getelementptr inbounds i8, i8* %A, i64 2
     43   store i8 %19, i8* %20, align 1
     44   ret i32 undef
     45 }
     46 
     47