llvm-project
82 строки · 2.7 Кб
1; RUN: opt %loadNPMPolly -polly-process-unprofitable=false \
2; RUN: -polly-detect-profitability-min-per-loop-insts=40 \
3; RUN: '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s -check-prefix=PROFITABLE
4
5; RUN: opt %loadNPMPolly -polly-process-unprofitable=true \
6; RUN: '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s -check-prefix=PROFITABLE
7
8; RUN: opt %loadNPMPolly -polly-process-unprofitable=false \
9; RUN: '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s -check-prefix=UNPROFITABLE
10
11; UNPROFITABLE-NOT: Valid Region for Scop:
12; PROFITABLE: Valid Region for Scop:
13
14; void foo(float *A, float *B, long N) {
15; for (long i = 0; i < 100; i++)
16; A[i] += .... / * a lot of compute */
17; }
18;
19target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20
21define void @foo(ptr %A, ptr %B, i64 %N) {
22entry:
23br label %header
24
25header:
26%i.0 = phi i64 [ 0, %entry ], [ %tmp10, %header ]
27%tmp5 = sitofp i64 %i.0 to float
28%tmp6 = getelementptr inbounds float, ptr %A, i64 %i.0
29%tmp7 = load float, ptr %tmp6, align 4
30%tmp8 = fadd float %tmp7, %tmp5
31%val0 = fadd float %tmp7, 1.0
32%val1 = fadd float %val0, 1.0
33%val2 = fadd float %val1, 1.0
34%val3 = fadd float %val2, 1.0
35%val4 = fadd float %val3, 1.0
36%val5 = fadd float %val4, 1.0
37%val6 = fadd float %val5, 1.0
38%val7 = fadd float %val6, 1.0
39%val8 = fadd float %val7, 1.0
40%val9 = fadd float %val8, 1.0
41%val10 = fadd float %val9, 1.0
42%val11 = fadd float %val10, 1.0
43%val12 = fadd float %val11, 1.0
44%val13 = fadd float %val12, 1.0
45%val14 = fadd float %val13, 1.0
46%val15 = fadd float %val14, 1.0
47%val16 = fadd float %val15, 1.0
48%val17 = fadd float %val16, 1.0
49%val18 = fadd float %val17, 1.0
50%val19 = fadd float %val18, 1.0
51%val20 = fadd float %val19, 1.0
52%val21 = fadd float %val20, 1.0
53%val22 = fadd float %val21, 1.0
54%val23 = fadd float %val22, 1.0
55%val24 = fadd float %val23, 1.0
56%val25 = fadd float %val24, 1.0
57%val26 = fadd float %val25, 1.0
58%val27 = fadd float %val26, 1.0
59%val28 = fadd float %val27, 1.0
60%val29 = fadd float %val28, 1.0
61%val30 = fadd float %val29, 1.0
62%val31 = fadd float %val30, 1.0
63%val32 = fadd float %val31, 1.0
64%val33 = fadd float %val32, 1.0
65%val34 = fadd float %val33, 1.0
66%val35 = fadd float %val34, 1.0
67%val36 = fadd float %val35, 1.0
68%val37 = fadd float %val36, 1.0
69%val38 = fadd float %val37, 1.0
70%val39 = fadd float %val38, 1.0
71%val40 = fadd float %val39, 1.0
72%val41 = fadd float %val40, 1.0
73%val42 = fadd float %val41, 1.0
74%val43 = fadd float %val42, 1.0
75store float %val34, ptr %tmp6, align 4
76%exitcond = icmp ne i64 %i.0, 100
77%tmp10 = add nsw i64 %i.0, 1
78br i1 %exitcond, label %header, label %exit
79
80exit:
81ret void
82}
83