llvm-project
58 строк · 2.5 Кб
1; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -aa-pipeline= -disable-output < %s | FileCheck %s --check-prefix=NOAA
2; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -aa-pipeline=basic-aa -disable-output < %s | FileCheck %s --check-prefix=BASI
3; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -aa-pipeline=tbaa -disable-output < %s | FileCheck %s --check-prefix=TBAA
4; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -aa-pipeline=scev-aa -disable-output < %s | FileCheck %s --check-prefix=SCEV
5; RUN: opt %loadNPMPolly '-passes=print<polly-ast>' -aa-pipeline=globals-aa -disable-output < %s | FileCheck %s --check-prefix=GLOB
6;
7; int A[1024];
8;
9;
10; void jd(float *B, int N) {
11; for (int i = 0; i < N; i++)
12; A[i] = B[i];
13; }
14;
15; NOAA: if (1 && 0 == N <= 0 && (&MemRef_B[N] <= &MemRef_A[0] || &MemRef_A[N] <= &MemRef_B[0]))
16; BASI: if (1 && 0 == N <= 0 && (&MemRef_B[N] <= &MemRef_A[0] || &MemRef_A[N] <= &MemRef_B[0]))
17; TBAA: if (1 && 0 == N <= 0)
18; SCEV: if (1 && 0 == N <= 0 && (&MemRef_B[N] <= &MemRef_A[0] || &MemRef_A[N] <= &MemRef_B[0]))
19; GLOB: if (1 && 0 == N <= 0 && (&MemRef_B[N] <= &MemRef_A[0] || &MemRef_A[N] <= &MemRef_B[0]))
20;
21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22
23@A = common global [1024 x i32] zeroinitializer, align 16
24
25define void @jd(ptr nocapture readonly %B, i32 %N) {
26entry:
27%cmp6 = icmp sgt i32 %N, 0
28br i1 %cmp6, label %for.body.preheader, label %for.end
29
30for.body.preheader: ; preds = %entry
31br label %for.body
32
33for.body: ; preds = %for.body.preheader, %for.body
34%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
35%arrayidx = getelementptr inbounds float, ptr %B, i64 %indvars.iv
36%tmp = load float, ptr %arrayidx, align 4, !tbaa !1
37%conv = fptosi float %tmp to i32
38%arrayidx2 = getelementptr inbounds [1024 x i32], ptr @A, i64 0, i64 %indvars.iv
39store i32 %conv, ptr %arrayidx2, align 4, !tbaa !5
40%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
41%lftr.wideiv1 = trunc i64 %indvars.iv.next to i32
42%exitcond2 = icmp eq i32 %lftr.wideiv1, %N
43br i1 %exitcond2, label %for.end.loopexit, label %for.body
44
45for.end.loopexit: ; preds = %for.body
46br label %for.end
47
48for.end: ; preds = %for.end.loopexit, %entry
49ret void
50}
51
52!0 = !{!""}
53!1 = !{!2, !2, i64 0}
54!2 = !{!"float", !3, i64 0}
55!3 = !{!"omnipotent char", !4, i64 0}
56!4 = !{!"Simple C/C++ TBAA"}
57!5 = !{!6, !6, i64 0}
58!6 = !{!"int", !3, i64 0}
59