1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-function-scops -analyze < %s | FileCheck %s
4 ; CHECK: Reduction Type: NONE
6 ; Check that we do not mark these accesses as reduction like.
7 ; We do this for the case the loads are modelt with the same LLVM-IR value and
8 ; for the case there are different LLVM-IR values.
11 ; for (int i = 0; i < 1024; i++)
15 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
17 define void @f_one_load_case(i32* %A) {
21 for.cond: ; preds = %for.inc, %entry
22 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
23 %exitcond = icmp ne i32 %i.0, 1024
24 br i1 %exitcond, label %for.body, label %for.end
26 for.body: ; preds = %for.cond
27 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
28 %tmp = load i32, i32* %arrayidx, align 4
29 %add = add nsw i32 %tmp, %tmp
30 %arrayidx2 = getelementptr inbounds i32, i32* %A, i32 %i.0
31 store i32 %add, i32* %arrayidx2, align 4
34 for.inc: ; preds = %for.body
35 %inc = add nsw i32 %i.0, 1
38 for.end: ; preds = %for.cond
42 define void @f_two_loads_case(i32* %A) {
46 for.cond: ; preds = %for.inc, %entry
47 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
48 %exitcond = icmp ne i32 %i.0, 1024
49 br i1 %exitcond, label %for.body, label %for.end
51 for.body: ; preds = %for.cond
52 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
53 %tmp = load i32, i32* %arrayidx, align 4
54 %arrayidxCopy = getelementptr inbounds i32, i32* %A, i32 %i.0
55 %tmpCopy = load i32, i32* %arrayidxCopy, align 4
56 %add = add nsw i32 %tmp, %tmpCopy
57 %arrayidx2 = getelementptr inbounds i32, i32* %A, i32 %i.0
58 store i32 %add, i32* %arrayidx2, align 4
61 for.inc: ; preds = %for.body
62 %inc = add nsw i32 %i.0, 1
65 for.end: ; preds = %for.cond