1 ; RUN: opt %loadPolly -polly-codegen -polly-ast-detect-parallel -S < %s | FileCheck %s
3 ; Check that we mark multiple parallel loops correctly including the memory instructions.
5 ; CHECK-DAG: %polly.loop_cond[[COuter:[0-9]*]] = icmp sle i64 %polly.indvar_next{{[0-9]*}}, 1023
6 ; CHECK-DAG: br i1 %polly.loop_cond[[COuter]], label %polly.loop_header{{[0-9]*}}, label %polly.loop_exit{{[0-9]*}}, !llvm.loop ![[IDOuter:[0-9]*]]
8 ; CHECK-DAG: %polly.loop_cond[[CInner:[0-9]*]] = icmp sle i64 %polly.indvar_next{{[0-9]*}}, 511
9 ; CHECK-DAG: br i1 %polly.loop_cond[[CInner]], label %polly.loop_header{{[0-9]*}}, label %polly.loop_exit{{[0-9]*}}, !llvm.loop ![[IDInner:[0-9]*]]
11 ; CHECK-DAG: store i32 %{{[a-z_0-9]*}}, ptr %{{[a-z_0-9]*}}, {{[ ._!,a-zA-Z0-9]*}}, !llvm.access.group ![[GROUPLST6:[0-9]+]]
13 ; CHECK-DAG: ![[IDOuter]] = distinct !{![[IDOuter]], ![[ACCGROUP1:[0-9]+]]}
14 ; CHECK-DAG: ![[ACCGROUP1]] = !{!"llvm.loop.parallel_accesses", ![[GROUP2:[0-9]+]]}
15 ; CHECK-DAG: ![[GROUP2]] = distinct !{}
16 ; CHECK-DAG: ![[GROUPLST6]] = !{![[GROUP2]], ![[GROUP7:[0-9]+]]}
17 ; CHECK-DAG: ![[GROUP7]] = distinct !{}
18 ; CHECK-DAG: ![[IDInner]] = distinct !{![[IDInner]], ![[ACCGROUP9:[0-9]+]]}
19 ; CHECK-DAG: ![[ACCGROUP9]] = !{!"llvm.loop.parallel_accesses", ![[GROUP7]]}
24 ; for (int i = 0; i < 1024; i++)
25 ; for (int j = 0; j < 512; j++)
26 ; A[i * 512 + j] = i + j;
29 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31 define void @jd(ptr %A) {
35 for.cond: ; preds = %for.inc5, %entry
36 %indvars.iv3 = phi i64 [ %indvars.iv.next4, %for.inc5 ], [ 0, %entry ]
37 %exitcond6 = icmp ne i64 %indvars.iv3, 1024
38 br i1 %exitcond6, label %for.body, label %for.end7
40 for.body: ; preds = %for.cond
43 for.cond1: ; preds = %for.inc, %for.body
44 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ]
45 %exitcond = icmp ne i64 %indvars.iv, 512
46 br i1 %exitcond, label %for.body3, label %for.end
48 for.body3: ; preds = %for.cond1
49 %tmp = add nsw i64 %indvars.iv3, %indvars.iv
50 %tmp7 = shl nsw i64 %indvars.iv3, 9
51 %tmp8 = add nsw i64 %tmp7, %indvars.iv
52 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %tmp8
53 %tmp9 = trunc i64 %tmp to i32
54 store i32 %tmp9, ptr %arrayidx, align 4
57 for.inc: ; preds = %for.body3
58 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
61 for.end: ; preds = %for.cond1
64 for.inc5: ; preds = %for.end
65 %indvars.iv.next4 = add nuw nsw i64 %indvars.iv3, 1
68 for.end7: ; preds = %for.cond