1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN
4 ; Check for correct code generation of exit PHIs, even if the same PHI value
5 ; is used again inside the the SCoP.
6 ; Note that if.else113 is removed from the SCoP because it is never executed.
8 ; CHECK: Region: %for.body
11 ; CHECK-NEXT: double MemRef_up_3_ph; // Element size 8
12 ; CHECK-NEXT: ptr MemRef_A[*]; // Element size 8
13 ; CHECK-NEXT: double MemRef_up_3_ph; // Element size 8
16 ; CODEGEN: polly.merge_new_and_old:
17 ; CODEGEN-NEXT: %up.3.ph.ph.merge = phi double [ %up.3.ph.ph.final_reload, %polly.exiting ], [ undef, %for.cond.outer304.region_exiting ]
19 ; CODEGEN: for.cond.outer304:
20 ; CODEGEN-NEXT: %indvar = phi i64 [ %indvar.next, %polly.merge_new_and_old ], [ 0, %entry ]
21 ; CODEGEN-NEXT: %up.3.ph = phi double [ 0.000000e+00, %entry ], [ %up.3.ph.ph.merge, %polly.merge_new_and_old ]
23 ; CODEGEN: polly.stmt.if.then111:
24 ; CODEGEN-NEXT: store double undef, ptr %up.3.ph.s2a
26 ; CODEGEN: polly.exiting:
27 ; CODEGEN-NEXT: %up.3.ph.ph.final_reload = load double, ptr %up.3.ph.s2a
29 ; ModuleID = 'bugpoint-reduced-simplified.bc'
30 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
32 ; Function Attrs: uwtable
33 define void @_ZN6soplex14SPxAggregateSM9eliminateERKNS_7SVectorEd(ptr nocapture readonly %A) {
35 br label %for.cond.outer304
37 for.cond.outer304: ; preds = %if.else113, %if.then111, %entry
38 %up.3.ph = phi double [ 0.000000e+00, %entry ], [ undef, %if.else113 ], [ undef, %if.then111 ]
39 br i1 undef, label %for.body, label %for.end
41 for.body: ; preds = %for.cond.outer304
42 %0 = load ptr, ptr %A, align 8
43 %add = fadd double %up.3.ph, undef
44 br i1 false, label %if.else113, label %if.then111
46 if.then111: ; preds = %for.body
47 br label %for.cond.outer304
49 if.else113: ; preds = %for.body
50 br label %for.cond.outer304
52 for.end: ; preds = %for.cond.outer304