1; RUN: opt %loadPolly -polly-codegen -polly-vectorizer=polly -S < %s | FileCheck %s
2
3; ModuleID = 'reverse.c'
4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5
6;int A[100];
7;void foo() {
8;  for (int i=3; i >= 0; i--)
9;    A[i]+=1;
10;}
11
12
13@A = common global [100 x i32] zeroinitializer, align 16
14
15; Function Attrs: nounwind uwtable
16define void @foo() #0 {
17entry:
18  br label %for.body
19
20for.body:                                         ; preds = %entry, %for.body
21  %indvars.iv = phi i64 [ 3, %entry ], [ %indvars.iv.next, %for.body ]
22  %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @A, i64 0, i64 %indvars.iv
23  %0 = load i32, i32* %arrayidx, align 4
24  %add = add nsw i32 %0, 1
25  store i32 %add, i32* %arrayidx, align 4
26  %indvars.iv.next = add nsw i64 %indvars.iv, -1
27  %1 = trunc i64 %indvars.iv to i32
28  %cmp = icmp sgt i32 %1, 0
29  br i1 %cmp, label %for.body, label %for.end
30
31for.end:                                          ; preds = %for.body
32  ret void
33}
34
35; CHECK: @foo
36; CHECK: [[LOAD:%[a-zA-Z0-9_]+]] = load <4 x i32>, <4 x i32>*
37; CHECK: [[REVERSE_LOAD:%[a-zA-Z0-9_]+reverse]] = shufflevector <4 x i32> [[LOAD]], <4 x i32> [[LOAD]], <4 x i32> <i32 3, i32 2, i32 1, i32 0>
38