Files
clang-p2996/polly/test/Isl/CodeGen/phi_with_one_exit_edge.ll
Tobias Grosser 2d3d4ec860 executeScopConditionally: Introduce special exiting block
When introducing separate control flow for the original and optimized code we
introduce now a special 'ExitingBlock':

      \   /
    EnteringBB
        |
    SplitBlock---------\
   _____|_____         |
  /  EntryBB  \    StartBlock
  |  (region) |        |
  \_ExitingBB_/   ExitingBlock
        |              |
    MergeBlock---------/
        |
      ExitBB
      /    \

This 'ExitingBlock' contains code such as the final_reloads for scalars, which
previously were just added to whichever statement/loop_exit/branch-merge block
had been generated last. Having an explicit basic block makes it easier to
find these constructs when looking at the CFG.

llvm-svn: 255107
2015-12-09 11:38:22 +00:00

33 lines
801 B
LLVM

; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
;
;
; CHECK: polly.merge_new_and_old:
; CHECK: %sumA.merge = phi float [ %sumA.final_reload, %polly.exiting ], [ %sumA, %loopA ]
; CHECK: br label %next
;
; CHECK: next:
; CHECK: %result = phi float [ %sumA.merge, %polly.merge_new_and_old ]
; CHECK: ret float %result
;
define float @foo(float* %A, i64 %param) {
entry:
br label %entry.split
entry.split:
br label %loopA
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
next:
%result = phi float [%sumA, %loopA]
ret float %result
}