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