reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
;
; CHECK: polly.merge_new_and_old:
; CHECK:   %result.ph.merge = phi float [ %result.ph.final_reload, %polly.exiting ], [ %result.ph, %next.region_exiting ]
; CHECK:   br label %next
;
; CHECK: next:
; CHECK:   %result = phi float [ %result.ph.merge, %polly.merge_new_and_old ]
; CHECK:   ret float %result

define float @foo(float* %A, i64 %param) {
entry:
  br label %entry.split

entry.split:
  %branchcond = icmp slt i64 %param, 64
  br i1 %branchcond, label %loopA, label %loopB

loopA:
  %indvarA = phi i64 [0, %entry.split], [%indvar.nextA, %loopA]
  %indvar.nextA = add i64 %indvarA, 1
  %valA = load float, float* %A
  %sumA = fadd float %valA, %valA
  store float %valA, float* %A
  %cndA = icmp eq i64 %indvar.nextA, 100
  br i1 %cndA, label %next, label %loopA

loopB:
  %indvarB = phi i64 [0, %entry.split], [%indvar.nextB, %loopB]
  %indvar.nextB = add i64 %indvarB, 1
  %valB = load float, float* %A
  %sumB = fadd float %valB, %valB
  store float %valB, float* %A
  %cndB = icmp eq i64 %indvar.nextB, 100
  br i1 %cndB, label %next, label %loopB

next:
  %result = phi float [%sumA, %loopA], [%sumB, %loopB]
  ret float %result

}