Files
clang-p2996/polly/test/ScopInfo/exit_phi_accesses-2.ll
Michael Kruse a43ba2d84f [ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.
Splitting basic blocks into multiple statements if there are now
additional scalar dependencies gives more freedom to the scheduler, but
more statements also means higher compile-time complexity. Switch to
finer statement granularity, the additional compile time should be
limited by the number of operations quota.

The regression tests are written for the -polly-stmt-granularity=bb
setting, therefore we add that flag to those tests that break with the
new default. Some of the tests only fail because the statements are
named differently due to a basic block resulting in multiple statements,
but which are removed during simplification of statements without
side-effects. Previous commits tried to reduce this effect, but it is
not completely avoidable.

Differential Revision: https://reviews.llvm.org/D42151

llvm-svn: 324169
2018-02-03 06:59:47 +00:00

49 lines
1.6 KiB
LLVM

; RUN: opt %loadPolly -polly-stmt-granularity=bb -analyze -polly-scops %s | FileCheck %s
; CHECK-LABEL: Function: foo
;
; CHECK: Statements {
; CHECK-NEXT: Stmt_body
; CHECK-NEXT: Domain :=
; CHECK-NEXT: { Stmt_body[i0] : 0 <= i0 <= 100 };
; CHECK-NEXT: Schedule :=
; CHECK-NEXT: { Stmt_body[i0] -> [i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0] -> MemRef_sum__phi[] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0] -> MemRef_sum__phi[] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_body[i0] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0] -> MemRef_sum_next[] };
; CHECK-NEXT: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define float @foo(float* %A) {
entry:
br label %header
header:
fence seq_cst
br i1 true, label %body, label %exit
body:
%i = phi i64 [ 0, %header ], [ %next, %body ]
%sum = phi float [ 0.0, %header ], [ %sum.next, %body ]
%arrayidx = getelementptr float, float* %A, i64 %i
%scalar = fadd float 0.0, 0.0
%next = add nuw nsw i64 %i, 1
%val = load float, float* %arrayidx
%sum.next = fadd float %sum, %val
%cond = icmp ne i64 %i, 100
br i1 %cond, label %body, label %after
after:
br label %exit
exit:
%phi = phi float [%sum.next, %after], [0.0, %header]
ret float %phi
}