• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s
2; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN
3;
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.
7;
8; CHECK: Region: %for.body
9;
10; CHECK:         Arrays {
11; CHECK-NEXT:        double MemRef_up_3_ph; // Element size 8
12; CHECK-NEXT:        i32* MemRef_A[*]; // Element size 8
13; CHECK-NEXT:        double MemRef_up_3_ph; // Element size 8
14; CHECK-NEXT:    }
15;
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 ]
18;
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 ]
22;
23; CODEGEN:      polly.stmt.if.then111:
24; CODEGEN-NEXT:   store double undef, double* %up.3.ph.s2a
25;
26; CODEGEN:      polly.exiting:
27; CODEGEN-NEXT:   %up.3.ph.ph.final_reload = load double, double* %up.3.ph.s2a
28;
29; ModuleID = 'bugpoint-reduced-simplified.bc'
30target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31
32; Function Attrs: uwtable
33define void @_ZN6soplex14SPxAggregateSM9eliminateERKNS_7SVectorEd(i32** nocapture readonly %A) {
34entry:
35  br label %for.cond.outer304
36
37for.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
40
41for.body:                                         ; preds = %for.cond.outer304
42  %0 = load i32*, i32** %A, align 8
43  %add = fadd double %up.3.ph, undef
44  %val.i.i.i235 = getelementptr inbounds i32, i32* %0, i64 0
45  br i1 false, label %if.else113, label %if.then111
46
47if.then111:                                       ; preds = %for.body
48  br label %for.cond.outer304
49
50if.else113:                                       ; preds = %for.body
51  br label %for.cond.outer304
52
53for.end:                                          ; preds = %for.cond.outer304
54  ret void
55}
56