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