1; RUN: opt %loadPolly -polly-simplify -analyze < %s | FileCheck %s -match-full-lines
2; RUN: opt %loadPolly "-passes=scop(print<polly-simplify>)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines
3;
4; Do not remove dependencies of a phi node in a region's exit block.
5;
6define void @func(i32 %n, double* noalias nonnull %A, double %alpha) {
7entry:
8  br label %for
9
10for:
11  %j = phi i32 [0, %entry], [%j.inc, %inc]
12  %j.cmp = icmp slt i32 %j, %n
13  br i1 %j.cmp, label %body, label %exit
14
15    body:
16      %val = fadd double 21.0, 21.0
17      br label %region_entry
18
19
20    region_entry:
21      %region.cmp = fcmp ueq double %alpha, 0.0
22      br i1 %region.cmp, label %region_true, label %region_exit
23
24    region_true:
25      br label %region_exit
26
27    region_exit:
28      %phi = phi double [%val, %region_true], [0.0, %region_entry]
29      store double %phi, double* %A
30      br label %inc
31
32
33inc:
34  %j.inc = add nuw nsw i32 %j, 1
35  br label %for
36
37exit:
38  br label %return
39
40return:
41  ret void
42}
43
44
45; CHECK: SCoP could not be simplified
46