annotate polly/test/CodeGen/multiple-codegens.ll @ 252:1f2b6ac9f198 llvm-original

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