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
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s

declare void @bar()

define void @foo(float* %A, i64 %p) {
start:
   br label %next

next:
   %cmpA = icmp sle i64 %p, 0
   br i1 %cmpA, label %error, label %ok

error:
   call void @bar()
   br label %merge

ok:
   br label %merge

merge:
   %phi = phi i64 [0, %error], [1, %ok]
   store float 42.0, float* %A
   %cmp = icmp eq i64 %phi, %p
   br i1 %cmp, label %loop, label %exit

loop:
   %indvar = phi i64 [0, %merge], [%indvar.next, %loop]
   store float 42.0, float* %A
   %indvar.next = add i64 %indvar, 1
   %cmp2 = icmp sle i64 %indvar, 1024
   br i1 %cmp2, label %loop, label %exit

exit:
   ret void
}

; CHECK:      Statements {
; CHECK-NEXT: 	Stmt_ok
; CHECK-NEXT:         Domain :=
; CHECK-NEXT:             [p] -> { Stmt_ok[] : p > 0 };
; CHECK-NEXT:         Schedule :=
; CHECK-NEXT:             [p] -> { Stmt_ok[] -> [0, 0] };
; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT:             [p] -> { Stmt_ok[] -> MemRef_phi__phi[] };
; CHECK-NEXT: 	Stmt_merge
; CHECK-NEXT:         Domain :=
; CHECK-NEXT:             [p] -> { Stmt_merge[] };
; CHECK-NEXT:         Schedule :=
; CHECK-NEXT:             [p] -> { Stmt_merge[] -> [1, 0] };
; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT:             [p] -> { Stmt_merge[] -> MemRef_phi__phi[] };
; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT:             [p] -> { Stmt_merge[] -> MemRef_A[0] };
; CHECK-NEXT: 	Stmt_loop
; CHECK-NEXT:         Domain :=
; CHECK-NEXT:             [p] -> { Stmt_loop[i0] : p = 1 and 0 <= i0 <= 1025 };
; CHECK-NEXT:         Schedule :=
; CHECK-NEXT:             [p] -> { Stmt_loop[i0] -> [2, i0] };
; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_A[0] };
; CHECK-NEXT: }