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