1; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
2;
3; llvm.org/PR25439
4; The dominance of the generated non-affine subregion block was based on the
5; scop's merge block, therefore resulted in an invalid DominanceTree.
6; It resulted in some values as assumed to be unusable in the actual generated
7; exit block. Here we check whether the value %escaping is taken from the
8; generated block.
9;
10; CHECK-LABEL: polly.stmt.subregion_entry:
11; CHECK:         %p_escaping = select i1 undef, i32 undef, i32 undef
12;
13; CHECK-LABEL: polly.stmt.polly.merge_new_and_old.exit:
14; CHECK:         store i32 %p_escaping, i32* %escaping.s2a
15
16define i32 @func() {
17entry:
18  br label %subregion_entry
19
20subregion_entry:
21  %escaping = select i1 undef, i32 undef, i32 undef
22  %cond = or i1 undef, undef
23  br i1 %cond, label %subregion_exit, label %subregion_if
24
25subregion_if:
26  br label %subregion_exit
27
28subregion_exit:
29  ret i32 %escaping
30}
31