236
|
1 ; RUN: opt %loadPolly -polly-scops -polly-opt-isl -polly-codegen -polly-scops -polly-codegen -S < %s | FileCheck %s
|
|
2 ; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen,polly-codegen)" -S < %s | FileCheck %s
|
|
3 ; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen),scop(polly-codegen)" -S < %s | FileCheck %s
|
|
4 ;
|
|
5 ; llvm.org/PR34441
|
|
6 ; Properly handle multiple -polly-scops/-polly-codegen in the same
|
|
7 ; RegionPassManager. -polly-codegen must not reuse the -polly-ast analysis the
|
|
8 ; was created for the first -polly-scops pass.
|
|
9 ; The current solution is that only the first -polly-codegen is allowed to
|
|
10 ; generate code, the second detects it is re-using an IslAst that belongs to a
|
|
11 ; different ScopInfo.
|
|
12 ;
|
|
13 ; int a, b, c;
|
|
14 ;
|
|
15 ; int main () {
|
|
16 ; while (a++)
|
|
17 ; while (b) {
|
|
18 ; c = 0;
|
|
19 ; break;
|
|
20 ; }
|
|
21 ; return 0;
|
|
22 ; }
|
|
23 ;
|
|
24 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
|
25
|
|
26 @a = common global i32 0, align 4
|
|
27 @b = common global i32 0, align 4
|
|
28 @c = common global i32 0, align 4
|
|
29
|
|
30 ; Function Attrs: nounwind uwtable
|
|
31 define i32 @main() {
|
|
32 entry:
|
|
33 %retval = alloca i32, align 4
|
252
|
34 store i32 0, ptr %retval, align 4
|
|
35 %.pre = load i32, ptr @a, align 4
|
236
|
36 br label %while.cond
|
|
37
|
|
38 while.cond: ; preds = %while.end, %entry
|
|
39 %0 = phi i32 [ %inc, %while.end ], [ %.pre, %entry ]
|
|
40 %inc = add nsw i32 %0, 1
|
252
|
41 store i32 %inc, ptr @a, align 4
|
236
|
42 %tobool = icmp ne i32 %0, 0
|
|
43 br i1 %tobool, label %while.body, label %while.end4
|
|
44
|
|
45 while.body: ; preds = %while.cond
|
252
|
46 %1 = load i32, ptr @b, align 4
|
236
|
47 %tobool2 = icmp ne i32 %1, 0
|
|
48 br i1 %tobool2, label %while.body3, label %while.end
|
|
49
|
|
50 while.body3: ; preds = %while.body
|
252
|
51 store i32 0, ptr @c, align 4
|
236
|
52 br label %while.end
|
|
53
|
|
54 while.end: ; preds = %while.body3, %while.body
|
|
55 br label %while.cond
|
|
56
|
|
57 while.end4: ; preds = %while.cond
|
|
58 ret i32 0
|
|
59 }
|
|
60
|
|
61
|
|
62 ; CHECK: polly.start:
|
|
63 ; CHECK-NOT: polly.start:
|