1 ; RUN: opt < %s -loop-vectorize -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7 -S | FileCheck %s
2 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; Function Attrs: nounwind uwtable
6 define void @test1(float* noalias nocapture %a, float* noalias nocapture readonly %b) #0 {
23 for.body: ; preds = %for.body, %entry
24 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
25 %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv
26 %0 = load float, float* %arrayidx, align 4
27 %cmp1 = fcmp ogt float %0, 1.000000e+02
28 tail call void @llvm.assume(i1 %cmp1)
29 %add = fadd float %0, 1.000000e+00
30 %arrayidx5 = getelementptr inbounds float, float* %a, i64 %indvars.iv
31 store float %add, float* %arrayidx5, align 4
32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
33 %exitcond = icmp eq i64 %indvars.iv, 1599
34 br i1 %exitcond, label %for.end, label %for.body
36 for.end: ; preds = %for.body
40 ; Function Attrs: nounwind
41 declare void @llvm.assume(i1) #1
43 attributes #0 = { nounwind uwtable }
44 attributes #1 = { nounwind }
46 %struct.data = type { float*, float* }
48 ; Function Attrs: nounwind uwtable
49 define void @test2(%struct.data* nocapture readonly %d) #0 {
51 %b = getelementptr inbounds %struct.data, %struct.data* %d, i64 0, i32 1
52 %0 = load float*, float** %b, align 8
53 %ptrint = ptrtoint float* %0 to i64
54 %maskedptr = and i64 %ptrint, 31
55 %maskcond = icmp eq i64 %maskedptr, 0
56 %a = getelementptr inbounds %struct.data, %struct.data* %d, i64 0, i32 0
57 %1 = load float*, float** %a, align 8
58 %ptrint2 = ptrtoint float* %1 to i64
59 %maskedptr3 = and i64 %ptrint2, 31
60 %maskcond4 = icmp eq i64 %maskedptr3, 0
84 for.body: ; preds = %for.body, %entry
85 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
86 tail call void @llvm.assume(i1 %maskcond)
87 %arrayidx = getelementptr inbounds float, float* %0, i64 %indvars.iv
88 %2 = load float, float* %arrayidx, align 4
89 %add = fadd float %2, 1.000000e+00
90 tail call void @llvm.assume(i1 %maskcond4)
91 %arrayidx5 = getelementptr inbounds float, float* %1, i64 %indvars.iv
92 store float %add, float* %arrayidx5, align 4
93 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
94 %exitcond = icmp eq i64 %indvars.iv, 1599
95 br i1 %exitcond, label %for.end, label %for.body
97 for.end: ; preds = %for.body