Sanjay Patel | b653de1 | 2014-09-10 17:58:16 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -S | FileCheck %s |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 2 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 3 | |
| 4 | ; Function Attrs: nounwind uwtable |
| 5 | define i32 @test1(i32* nocapture %a, float* nocapture readonly %b) #0 { |
| 6 | entry: |
| 7 | br label %for.body |
| 8 | |
| 9 | for.body: ; preds = %for.body, %entry |
| 10 | %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 11 | %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 12 | %0 = load float, float* %arrayidx, align 4, !tbaa !0 |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 13 | %conv = fptosi float %0 to i32 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 14 | %arrayidx2 = getelementptr inbounds i32, i32* %a, i64 %indvars.iv |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 15 | store i32 %conv, i32* %arrayidx2, align 4, !tbaa !4 |
| 16 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 17 | %exitcond = icmp eq i64 %indvars.iv.next, 1600 |
| 18 | br i1 %exitcond, label %for.end, label %for.body |
| 19 | |
| 20 | for.end: ; preds = %for.body |
| 21 | ret i32 0 |
| 22 | } |
| 23 | |
| 24 | ; CHECK-LABEL: @test1 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 25 | ; CHECK: load <4 x float>, <4 x float>* %{{.*}}, align 4, !tbaa ![[TFLT:[0-9]+]] |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 26 | ; CHECK: store <4 x i32> %{{.*}}, <4 x i32>* %{{.*}}, align 4, !tbaa ![[TINT:[0-9]+]] |
| 27 | ; CHECK: ret i32 0 |
| 28 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 29 | ; CHECK-DAG: ![[TFLT]] = !{![[TFLT1:[0-9]+]] |
| 30 | ; CHECK-DAG: ![[TFLT1]] = !{!"float" |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 31 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 32 | ; CHECK-DAG: ![[TINT]] = !{![[TINT1:[0-9]+]] |
| 33 | ; CHECK-DAG: ![[TINT1]] = !{!"int" |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 34 | |
| 35 | attributes #0 = { nounwind uwtable } |
| 36 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 37 | !0 = !{!1, !1, i64 0} |
| 38 | !1 = !{!"float", !2, i64 0} |
| 39 | !2 = !{!"omnipotent char", !3, i64 0} |
| 40 | !3 = !{!"Simple C/C++ TBAA"} |
| 41 | !4 = !{!5, !5, i64 0} |
| 42 | !5 = !{!"int", !2, i64 0} |
Hal Finkel | 4f7d55a | 2014-07-19 13:33:16 +0000 | [diff] [blame] | 43 | |