• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -analyze  -polly-process-unprofitable \
2; RUN: -polly-scops -polly-use-llvm-names < %s |  FileCheck %s --check-prefix=SCOP
3
4; RUN: opt %loadPolly -S  -polly-process-unprofitable -polly-acc-mincompute=0 \
5; RUN: -polly-target=gpu  -polly-codegen-ppcg -polly-acc-codegen-managed-memory \
6; RUN: -polly-acc-rewrite-managed-memory < %s | FileCheck %s --check-prefix=HOST-IR
7
8; REQUIRES: pollyacc
9
10; SCOP:      Function: f
11; SCOP-NEXT: Region: %for.body---%for.end
12; SCOP-NEXT: Max Loop Depth:  1
13; SCOP: i32 MemRef_A[*];
14
15; Check that we generate a constructor call for @A.toptr
16; HOST-IR: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* {{.*}}, i8* bitcast (i32** @A.toptr to i8*) }]
17
18; Check that we generate a constructor
19; 4 bytes * 100 = 400
20; HOST-IR: define void {{.*}}constructor() {
21; HOST-IR-NEXT: entry:
22; HOST-IR-NEXT:   %mem.raw = call i8* @polly_mallocManaged(i64 400)
23; HOST-IR-NEXT:   %mem.typed = bitcast i8* %mem.raw to i32*
24; HOST-IR-NEXT:   store i32* %mem.typed, i32** @A.toptr
25; HOST-IR-NEXT:   ret void
26; HOST-IR-NEXT: }
27
28; HOST-IR-NOT: @A
29
30source_filename = "test.c"
31target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
32target triple = "x86_64-apple-macosx10.12.0"
33
34@A = internal global [100 x i32] zeroinitializer, align 16
35
36define void @f() {
37entry:
38  br label %entry.split
39
40entry.split:                                      ; preds = %entry
41  br label %for.body
42
43for.body:                                         ; preds = %entry.split, %for.body
44  %indvars.iv1 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next, %for.body ]
45  %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* @A, i64 0, i64 %indvars.iv1
46  store i32 42, i32* %arrayidx, align 4, !tbaa !3
47  %indvars.iv.next = add nuw nsw i64 %indvars.iv1, 1
48  %exitcond = icmp eq i64 %indvars.iv.next, 100
49  br i1 %exitcond, label %for.end, label %for.body
50
51for.end:                                          ; preds = %for.body
52  ret void
53}
54
55; Function Attrs: argmemonly nounwind
56declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #0
57
58
59; Function Attrs: argmemonly nounwind
60declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
61
62attributes #0 = { argmemonly nounwind }
63
64!llvm.module.flags = !{!0, !1}
65!llvm.ident = !{!2}
66
67!0 = !{i32 1, !"wchar_size", i32 4}
68!1 = !{i32 7, !"PIC Level", i32 2}
69!2 = !{!"clang version 6.0.0"}
70!3 = !{!4, !4, i64 0}
71!4 = !{!"int", !5, i64 0}
72!5 = !{!"omnipotent char", !6, i64 0}
73!6 = !{!"Simple C/C++ TBAA"}
74