xref: /llvm-project/llvm/test/Analysis/LoopInfo/annotated-parallel-simple.ll (revision 1aee1e1f4c4b504becc06521546de992a662694b)
1; RUN: opt -passes='print<loops>' -disable-output %s 2>&1 | FileCheck %s
2;
3; void func(long n, double A[static const restrict n]) {
4;   for (long i = 0; i < n; i += 1)
5;     A[i] = 21;
6; }
7;
8; Check that isAnnotatedParallel is working as expected.
9;
10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11
12define void @func(i64 %n, ptr noalias nonnull %A) {
13entry:
14  br label %for.cond
15
16for.cond:
17  %i.0 = phi i64 [ 0, %entry ], [ %add, %for.body ]
18  %cmp = icmp slt i64 %i.0, %n
19  br i1 %cmp, label %for.body, label %for.end
20
21for.body:
22  %arrayidx = getelementptr inbounds double, ptr %A, i64 %i.0
23  store double 2.100000e+01, ptr %arrayidx, align 8, !llvm.access.group !6
24  %add = add nuw nsw i64 %i.0, 1
25  br label %for.cond, !llvm.loop !7
26
27for.end:
28  ret void
29}
30
31!6 = distinct !{} ; access group
32
33!7 = distinct !{!7, !9} ; LoopID
34!9 = !{!"llvm.loop.parallel_accesses", !6}
35
36; CHECK: Loop info for function 'func':
37; CHECK: Parallel Loop at depth 1 containing:
38