1 ; RUN: opt %loadPolly -analyze -polly-process-unprofitable \
2 ; RUN: -polly-scops -polly-use-llvm-names < %s | FileCheck %s --check-prefix=SCOP
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
11 ; SCOP-NEXT: Region: %for.body---%for.end
12 ; SCOP-NEXT: Max Loop Depth: 1
13 ; SCOP: i32 MemRef_A[*];
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*) }]
18 ; Check that we generate a constructor
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
30 source_filename = "test.c"
31 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
32 target triple = "x86_64-apple-macosx10.12.0"
34 @A = internal global [100 x i32] zeroinitializer, align 16
40 entry.split: ; preds = %entry
43 for.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
51 for.end: ; preds = %for.body
55 ; Function Attrs: argmemonly nounwind
56 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #0
59 ; Function Attrs: argmemonly nounwind
60 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
62 attributes #0 = { argmemonly nounwind }
64 !llvm.module.flags = !{!0, !1}
67 !0 = !{i32 1, !"wchar_size", i32 4}
68 !1 = !{i32 7, !"PIC Level", i32 2}
69 !2 = !{!"clang version 6.0.0"}
71 !4 = !{!"int", !5, i64 0}
72 !5 = !{!"omnipotent char", !6, i64 0}
73 !6 = !{!"Simple C/C++ TBAA"}