1 ; RUN: opt %loadNPMPolly -passes=polly-codegen -S < %s | FileCheck %s
3 ; This caused the code generation to generate invalid code as the same BBMap was
4 ; used for the whole non-affine region. When %add is synthesized for the
5 ; incoming value of subregion_if first, the code for it was generated into
6 ; subregion_if, but reused for the incoming value of subregion_exit, although it
7 ; is not dominated by subregion_if.
9 ; CHECK-LABEL: polly.stmt.subregion_entry:
10 ; CHECK: %[[R0:[0-9]*]] = add i32 %n, -2
12 ; CHECK-LABEL: polly.stmt.subregion_if:
13 ; CHECK: %[[R1:[0-9]*]] = add i32 %n, -2
15 ; CHECK-LABEL: polly.stmt.subregion_exit.region_exiting:
16 ; CHECK: %polly.retval = phi i32 [ %[[R1]], %polly.stmt.subregion_if ], [ %[[R0]], %polly.stmt.subregion_entry ]
18 define i32 @func(i32 %n){
20 br label %subregion_entry
23 %add = add nsw i32 %n, -2
24 %cmp = fcmp ogt float undef, undef
25 br i1 %cmp, label %subregion_if, label %subregion_exit
28 br label %subregion_exit
31 %retval = phi i32 [ %add, %subregion_if ], [ %add, %subregion_entry ]