1;RUN: opt < %s -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -instcombine -S | FileCheck %s 2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4 5;; Check consecutive memory access without preceding GEP instruction 6 7; for (int i=0; i<len; i++) { 8; *to++ = *from++; 9; } 10 11; CHECK-LABEL: @consecutive_no_gep( 12; CHECK: vector.body 13; CHECK: %[[index:.*]] = phi i64 [ 0, %vector.ph ] 14; CHECK: getelementptr float, float* %{{.*}}, i64 %[[index]] 15; CHECK: load <4 x float> 16 17define void @consecutive_no_gep(float* noalias nocapture readonly %from, float* noalias nocapture %to, i32 %len) #0 { 18entry: 19 %cmp2 = icmp sgt i32 %len, 0 20 br i1 %cmp2, label %for.body.preheader, label %for.end 21 22for.body.preheader: ; preds = %entry 23 br label %for.body 24 25for.body: ; preds = %for.body.preheader, %for.body 26 %i.05 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ] 27 %from.addr.04 = phi float* [ %incdec.ptr, %for.body ], [ %from, %for.body.preheader ] 28 %to.addr.03 = phi float* [ %incdec.ptr1, %for.body ], [ %to, %for.body.preheader ] 29 %incdec.ptr = getelementptr inbounds float, float* %from.addr.04, i64 1 30 %val = load float, float* %from.addr.04, align 4 31 %incdec.ptr1 = getelementptr inbounds float, float* %to.addr.03, i64 1 32 store float %val, float* %to.addr.03, align 4 33 %inc = add nsw i32 %i.05, 1 34 %cmp = icmp slt i32 %inc, %len 35 br i1 %cmp, label %for.body, label %for.end.loopexit 36 37for.end.loopexit: ; preds = %for.body 38 br label %for.end 39 40for.end: ; preds = %for.end.loopexit, %entry 41 ret void 42} 43