1; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s | FileCheck %s 2; 3; llvm.org/PR25438 4; After loop versioning, a dominance check of a non-affine subregion's exit node 5; causes the dominance check to always fail any block in the scop. The 6; subregion's exit block has become polly_merge_new_and_old, which also receives 7; the control flow of the generated code. This would cause that any value for 8; implicit stores is assumed to be not from the scop. 9; 10; This checks that the stored value is indeed from the generated code. 11; 12; CHECK-LABEL: polly.stmt.do.body.entry: 13; CHECK: a.phiops.reload = load i32, ptr %a.phiops 14; 15; CHECK-LABEL: polly.stmt.polly.merge_new_and_old.exit: 16; CHECK: store i32 %polly.a, ptr %a.s2a 17 18define void @func() { 19entry: 20 br label %while.body 21 22while.body: 23 br label %do.body 24 25do.body: 26 %a = phi i32 [ undef, %while.body ], [ %b, %end_b ] 27 %cond = or i1 undef, undef 28 br i1 %cond, label %end_a, label %if_a 29 30if_a: 31 br label %end_a 32 33end_a: 34 br i1 undef, label %if_b, label %end_b 35 36if_b: 37 br label %end_b 38 39end_b: 40 %b = phi i32 [ undef, %if_b ], [ %a, %end_a ] 41 br i1 false, label %do.body, label %do.end 42 43do.end: 44 br label %return 45 46return: 47 ret void 48} 49