Files
clang-p2996/polly/test/Isl/CodeGen/partial_write_mapped_vector.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

58 lines
1.6 KiB
LLVM

; RUN: opt %loadPolly -basicaa -polly-stmt-granularity=bb -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-vectorizer=polly -polly-opt-isl -polly-ast -polly-codegen -S < %s | FileCheck %s
;
; Polly's vectorizer does not support partial accesses.
;
; for (int j = 0; j < 4; j += 1) {
;body:
; val = 21.0 + 21.0;
; if (j > 1)
;user:
; A[0] = val;
; }
define void @partial_write_mapped_vector(double* noalias nonnull %A) {
entry:
br label %for
for:
%j = phi i32 [0, %entry], [%j.inc, %inc]
%j.cmp = icmp slt i32 %j, 4
br i1 %j.cmp, label %body, label %exit
body:
%val = fadd double 21.0, 21.0
%if.cond = icmp sgt i32 %j, 1
br i1 %if.cond, label %user, label %inc
user:
%elt= getelementptr inbounds double, double* %A, i32 %j
store double %val, double* %elt
br label %inc
inc:
%j.inc = add nuw nsw i32 %j, 1
br label %for
exit:
br label %return
return:
ret void
}
; CHECK-LABEL: polly.stmt.body:
; CHECK-NEXT: %p_val = fadd double 2.100000e+01, 2.100000e+01
; CHECK-NEXT: %0 = trunc i64 %polly.indvar to i32
; CHECK-NEXT: %p_if.cond = icmp sgt i32 %0, 1
; CHECK-NEXT: %1 = icmp sge i64 %polly.indvar, 2
; CHECK-NEXT: %polly.Stmt_body_Write0.cond = icmp ne i1 %1, false
; CHECK-NEXT: br i1 %polly.Stmt_body_Write0.cond, label %polly.stmt.body.Stmt_body_Write0.partial, label %polly.stmt.body.cont
; CHECK-LABEL: polly.stmt.body.Stmt_body_Write0.partial:
; CHECK-NEXT: %polly.access.A = getelementptr double, double* %A, i64 1
; CHECK-NEXT: store double %p_val, double* %polly.access.A
; CHECK-NEXT: br label %polly.stmt.body.cont
; CHECK-LABEL: polly.stmt.body.cont: