1; RUN: opt %loadPolly -basic-aa -polly-import-jscop -polly-codegen -polly-vectorizer=polly -S < %s | FileCheck %s
2;
3; Check that we use the correct __new__ strides:
4;    stride zero for B
5;    stride one for A
6;
7; CHECK:  %polly.access.B = getelementptr i32, i32* %B, i64 0
8; CHECK:  %[[BC:[._a-zA-Z0-9]*]] = bitcast i32* %polly.access.B to <1 x i32>*
9; CHECK:  %[[LD:[._a-zA-Z0-9]*]] = load <1 x i32>, <1 x i32>* %[[BC]], align 8
10; CHECK:  %[[SV:[._a-zA-Z0-9]*]] = shufflevector <1 x i32> %[[LD]], <1 x i32> %[[LD]], <16 x i32> zeroinitializer
11;
12; CHECK:  %polly.access.A = getelementptr i32, i32* %A, i64 0
13; CHECK:  %[[VP:[._a-zA-Z0-9]*]] = bitcast i32* %polly.access.A to <16 x i32>*
14; CHECK:  store <16 x i32> %[[SV]], <16 x i32>* %[[VP]], align 8
15;
16;    void simple_stride(int *restrict A, int *restrict B) {
17;      for (int i = 0; i < 16; i++)
18;        A[i * 2] = B[i * 2];
19;    }
20;
21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22
23define void @simple_stride(i32* noalias %A, i32* noalias %B) {
24entry:
25  br label %for.cond
26
27for.cond:                                         ; preds = %for.inc, %entry
28  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
29  %exitcond = icmp ne i64 %indvars.iv, 16
30  br i1 %exitcond, label %for.body, label %for.end
31
32for.body:                                         ; preds = %for.cond
33  %tmp = shl nsw i64 %indvars.iv, 1
34  %arrayidx = getelementptr inbounds i32, i32* %B, i64 %tmp
35  %tmp4 = load i32, i32* %arrayidx, align 4
36  %tmp5 = shl nsw i64 %indvars.iv, 1
37  %arrayidx3 = getelementptr inbounds i32, i32* %A, i64 %tmp5
38  store i32 %tmp4, i32* %arrayidx3, align 4
39  br label %for.inc
40
41for.inc:                                          ; preds = %for.body
42  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
43  br label %for.cond
44
45for.end:                                          ; preds = %for.cond
46  ret void
47}
48