blob: 9a791aedbbe445bc4be9c05e838827afba16ae9a [file] [log] [blame]
Sanjay Patelb653de12014-09-10 17:58:16 +00001; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -S | FileCheck %s
Hal Finkel4f7d55a2014-07-19 13:33:16 +00002target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-unknown-linux-gnu"
4
5; Function Attrs: nounwind uwtable
6define i32 @test1(i32* nocapture %a, float* nocapture readonly %b) #0 {
7entry:
8 br label %for.body
9
10for.body: ; preds = %for.body, %entry
11 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
David Blaikie79e6c742015-02-27 19:29:02 +000012 %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv
David Blaikiea79ac142015-02-27 21:17:42 +000013 %0 = load float, float* %arrayidx, align 4, !tbaa !0
Hal Finkel4f7d55a2014-07-19 13:33:16 +000014 %conv = fptosi float %0 to i32
David Blaikie79e6c742015-02-27 19:29:02 +000015 %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
Hal Finkel4f7d55a2014-07-19 13:33:16 +000016 store i32 %conv, i32* %arrayidx2, align 4, !tbaa !4
17 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
18 %exitcond = icmp eq i64 %indvars.iv.next, 1600
19 br i1 %exitcond, label %for.end, label %for.body
20
21for.end: ; preds = %for.body
22 ret i32 0
23}
24
25; CHECK-LABEL: @test1
David Blaikiea79ac142015-02-27 21:17:42 +000026; CHECK: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ![[TFLT:[0-9]+]]
Hal Finkel4f7d55a2014-07-19 13:33:16 +000027; CHECK: store <4 x i32> %{{.*}}, <4 x i32>* %{{.*}}, align 4, !tbaa ![[TINT:[0-9]+]]
28; CHECK: ret i32 0
29
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000030; CHECK-DAG: ![[TFLT]] = !{![[TFLT1:[0-9]+]]
31; CHECK-DAG: ![[TFLT1]] = !{!"float"
Hal Finkel4f7d55a2014-07-19 13:33:16 +000032
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000033; CHECK-DAG: ![[TINT]] = !{![[TINT1:[0-9]+]]
34; CHECK-DAG: ![[TINT1]] = !{!"int"
Hal Finkel4f7d55a2014-07-19 13:33:16 +000035
36attributes #0 = { nounwind uwtable }
37
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000038!0 = !{!1, !1, i64 0}
39!1 = !{!"float", !2, i64 0}
40!2 = !{!"omnipotent char", !3, i64 0}
41!3 = !{!"Simple C/C++ TBAA"}
42!4 = !{!5, !5, i64 0}
43!5 = !{!"int", !2, i64 0}
Hal Finkel4f7d55a2014-07-19 13:33:16 +000044