1 ; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen,polly-codegen)" -S < %s | FileCheck %s
2 ; RUN: opt %loadNPMPolly "-passes=scop(polly-opt-isl,polly-codegen),scop(polly-codegen)" -S < %s | FileCheck %s
5 ; Properly handle multiple -polly-scops/-polly-codegen in the same
6 ; RegionPassManager. -polly-codegen must not reuse the -polly-ast analysis the
7 ; was created for the first -polly-scops pass.
8 ; The current solution is that only the first -polly-codegen is allowed to
9 ; generate code, the second detects it is re-using an IslAst that belongs to a
23 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
25 @a = common global i32 0, align 4
26 @b = common global i32 0, align 4
27 @c = common global i32 0, align 4
29 ; Function Attrs: nounwind uwtable
32 %retval = alloca i32, align 4
33 store i32 0, ptr %retval, align 4
34 %.pre = load i32, ptr @a, align 4
37 while.cond: ; preds = %while.end, %entry
38 %0 = phi i32 [ %inc, %while.end ], [ %.pre, %entry ]
39 %inc = add nsw i32 %0, 1
40 store i32 %inc, ptr @a, align 4
41 %tobool = icmp ne i32 %0, 0
42 br i1 %tobool, label %while.body, label %while.end4
44 while.body: ; preds = %while.cond
45 %1 = load i32, ptr @b, align 4
46 %tobool2 = icmp ne i32 %1, 0
47 br i1 %tobool2, label %while.body3, label %while.end
49 while.body3: ; preds = %while.body
50 store i32 0, ptr @c, align 4
53 while.end: ; preds = %while.body3, %while.body
56 while.end4: ; preds = %while.cond
62 ; CHECK-NOT: polly.start: