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