• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
2;
3; Check whether %newval is identified as escaping value, even though it is used
4; in a phi that is in the region. Non-affine subregion case.
5;
6; CHECK-LABEL: subregion_entry.region_entering:
7; CHECK:         %loop_carried.ph = phi float [ %newval.merge, %backedge ], [ undef, %entry ]
8;
9; CHECK-LABEL: polly.merge_new_and_old:
10; CHECK:         %newval.merge = phi float [ %newval.final_reload, %polly.exiting ], [ %newval, %subregion_exit.region_exiting ]
11;
12; CHECK-LABEL: polly.start:
13; CHECK:         store float %loop_carried.ph, float* %loop_carried.phiops
14;
15; CHECK-LABEL: polly.stmt.subregion_entry.entry:
16; CHECK:         %loop_carried.phiops.reload = load float, float* %loop_carried.phiops
17;
18; CHECK-LABEL: polly.stmt.subregion_entry:
19; CHECK:         %polly.loop_carried = phi float [ %loop_carried.phiops.reload, %polly.stmt.subregion_entry.entry ]
20; CHECK:         %p_newval = fadd float %polly.loop_carried, 1.000000e+00
21;
22; CHECK-LABEL: polly.stmt.polly.merge_new_and_old.exit:
23; CHECK:         %newval.final_reload = load float, float* %newval.s2a
24
25define void @func() {
26entry:
27  br label %subregion_entry
28
29subregion_entry:
30  %loop_carried = phi float [ undef, %entry ], [ %newval, %backedge ]
31  %indvar = phi i32 [ 1, %entry ], [ %indvar_next, %backedge ]
32  %newval = fadd float %loop_carried, 1.0
33  %cmp = fcmp ogt float undef, undef
34  br i1 %cmp, label %subregion_if, label %subregion_exit
35
36subregion_if:
37  br label %subregion_exit
38
39subregion_exit:
40  br i1 undef, label %if_then, label %if_else
41
42if_then:
43  br label %backedge
44
45if_else:
46  br label %backedge
47
48backedge:
49  %indvar_next = add nuw nsw i32 %indvar, 1
50  br i1 false, label %subregion_entry, label %exit
51
52exit:
53  ret void
54}
55