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
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
24 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
26 @a = common global i32 0, align 4
27 @b = common global i32 0, align 4
28 @c = common global i32 0, align 4
30 ; Function Attrs: nounwind uwtable
33 %retval = alloca i32, align 4
34 store i32 0, ptr %retval, align 4
35 %.pre = load i32, ptr @a, align 4
38 while.cond: ; preds = %while.end, %entry
39 %0 = phi i32 [ %inc, %while.end ], [ %.pre, %entry ]
40 %inc = add nsw i32 %0, 1
41 store i32 %inc, ptr @a, align 4
42 %tobool = icmp ne i32 %0, 0
43 br i1 %tobool, label %while.body, label %while.end4
45 while.body: ; preds = %while.cond
46 %1 = load i32, ptr @b, align 4
47 %tobool2 = icmp ne i32 %1, 0
48 br i1 %tobool2, label %while.body3, label %while.end
50 while.body3: ; preds = %while.body
51 store i32 0, ptr @c, align 4
54 while.end: ; preds = %while.body3, %while.body
57 while.end4: ; preds = %while.cond
63 ; CHECK-NOT: polly.start: