brintos

brintos / llvm-project-archived public Read only

0
0
Text · 969 B · 7307c21 Raw
38 lines · plain
1; RUN: opt -passes='print<loops>' -disable-output %s 2>&1 | FileCheck %s2;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.cond15 16for.cond:17  %i.0 = phi i64 [ 0, %entry ], [ %add, %for.body ]18  %cmp = icmp slt i64 %i.0, %n19  br i1 %cmp, label %for.body, label %for.end20 21for.body:22  %arrayidx = getelementptr inbounds double, ptr %A, i64 %i.023  store double 2.100000e+01, ptr %arrayidx, align 8, !llvm.access.group !624  %add = add nuw nsw i64 %i.0, 125  br label %for.cond, !llvm.loop !726 27for.end:28  ret void29}30 31!6 = distinct !{} ; access group32 33!7 = distinct !{!7, !9} ; LoopID34!9 = !{!"llvm.loop.parallel_accesses", !6}35 36; CHECK: Loop info for function 'func':37; CHECK: Parallel Loop at depth 1 containing:38