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