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 ;CHECK-LABEL: test1
      7 ;CHECK: load <2 x double>{{.*}}!tbaa ![[TBAA:[0-9]+]]
      8 ;CHECK: load <2 x double>{{.*}}!tbaa ![[TBAA]]
      9 ;CHECK: fmul <2 x double>{{.*}}!fpmath ![[FP1:[0-9]+]]
     10 ;CHECK: store <2 x double>{{.*}}!tbaa ![[TBAA]]
     11 ;CHECK: ret void
     12 
     13 define void @test1(double* %a, double* %b, double* %c) {
     14 entry:
     15   %i0 = load double, double* %a, align 8, !tbaa !4
     16   %i1 = load double, double* %b, align 8, !tbaa !4
     17   %mul = fmul double %i0, %i1, !fpmath !0
     18   %arrayidx3 = getelementptr inbounds double, double* %a, i64 1
     19   %i3 = load double, double* %arrayidx3, align 8, !tbaa !4
     20   %arrayidx4 = getelementptr inbounds double, double* %b, i64 1
     21   %i4 = load double, double* %arrayidx4, align 8, !tbaa !4
     22   %mul5 = fmul double %i3, %i4, !fpmath !0
     23   store double %mul, double* %c, align 8, !tbaa !4
     24   %arrayidx5 = getelementptr inbounds double, double* %c, i64 1
     25   store double %mul5, double* %arrayidx5, align 8, !tbaa !4
     26   ret void
     27 }
     28 
     29 ;CHECK-LABEL: test2
     30 ;CHECK: load <2 x double>{{.*}}!tbaa ![[TBAA]]
     31 ;CHECK: load <2 x double>{{.*}}!tbaa ![[TBAA]]
     32 ;CHECK: fmul <2 x double>{{.*}}!fpmath ![[FP2:[0-9]+]]
     33 ;CHECK: store <2 x double>{{.*}}!tbaa ![[TBAA]]
     34 ;CHECK: ret void
     35 
     36 define void @test2(double* %a, double* %b, i8* %e) {
     37 entry:
     38   %i0 = load double, double* %a, align 8, !tbaa !4
     39   %i1 = load double, double* %b, align 8, !tbaa !4
     40   %mul = fmul double %i0, %i1, !fpmath !1
     41   %arrayidx3 = getelementptr inbounds double, double* %a, i64 1
     42   %i3 = load double, double* %arrayidx3, align 8, !tbaa !4
     43   %arrayidx4 = getelementptr inbounds double, double* %b, i64 1
     44   %i4 = load double, double* %arrayidx4, align 8, !tbaa !4
     45   %mul5 = fmul double %i3, %i4, !fpmath !1
     46   %c = bitcast i8* %e to double*
     47   store double %mul, double* %c, align 8, !tbaa !4
     48   %carrayidx5 = getelementptr inbounds i8, i8* %e, i64 8
     49   %arrayidx5 = bitcast i8* %carrayidx5 to double*
     50   store double %mul5, double* %arrayidx5, align 8, !tbaa !4
     51   ret void
     52 }
     53 
     54 ;CHECK-DAG: ![[TBAA]] = !{[[TYPEC:!.*]], [[TYPEC]], i64 0}
     55 ;CHECK-DAG: ![[FP1]] = !{float 5.000000e+00}
     56 ;CHECK-DAG: ![[FP2]] = !{float 2.500000e+00}
     57 !0 = !{ float 5.0 }
     58 !1 = !{ float 2.5 }
     59 !2 = !{!"Simple C/C++ TBAA"}
     60 !3 = !{!"omnipotent char", !2}
     61 !4 = !{!"double", !3}
     62