Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,112 @@
set(LLVM_SHLIBEXT "${CMAKE_SHARED_MODULE_SUFFIX}")
add_custom_target(check-polly)
set_target_properties(check-polly PROPERTIES FOLDER "Polly")
if(NOT LLVM_MAIN_SRC_DIR)
find_program(LLVM_OPT NAMES opt HINTS ${LLVM_TOOLS_BINARY_DIR})
find_program(LLVM_FILECHECK NAMES FileCheck HINTS ${LLVM_TOOLS_BINARY_DIR})
find_program(LLVM_NOT NAMES not HINTS ${LLVM_TOOLS_BINARY_DIR})
if (NOT LLVM_OPT)
message(WARNING "LLVM's opt program could not be found. Please set LLVM_OPT.")
endif()
if (NOT LLVM_FILECHECK)
message(WARNING "LLVM's FileCheck program could not be found. "
"Please set LLVM_FILECHECK. Please set LLVM_FILECHECK.")
endif()
if (NOT LLVM_NOT)
message(WARNING "LLVM's not program could not be found. Please set LLVM_NOT.")
endif()
get_filename_component(EXTRA_PATHS ${LLVM_OPT} DIRECTORY)
list(APPEND POLLY_TEST_EXTRA_PATHS "${EXTRA_PATHS}")
get_filename_component(EXTRA_PATHS ${LLVM_FILECHECK} DIRECTORY)
list(APPEND POLLY_TEST_EXTRA_PATHS "${EXTRA_PATHS}")
get_filename_component(EXTRA_PATHS ${LLVM_NOT} DIRECTORY)
list(APPEND POLLY_TEST_EXTRA_PATHS "${EXTRA_PATHS}")
list(REMOVE_DUPLICATES POLLY_TEST_EXTRA_PATHS)
message(STATUS "Extra paths: ${POLLY_TEST_EXTRA_PATHS}")
if ("${POLLY_TEST_EXTRA_PATHS}" STREQUAL "${LLVM_TOOLS_BINARY_DIR}")
set(POLLY_TEST_EXTRA_PATHS "")
endif()
set(POLLY_TEST_DEPS LLVMPolly)
else ()
set(LLVM_OPT "${LLVM_TOOLS_BINARY_DIR}/opt")
set(LLVM_FILECHECK "${LLVM_TOOLS_BINARY_DIR}/FileCheck")
set(LLVM_NOT "${LLVM_TOOLS_BINARY_DIR}/not")
set(POLLY_TEST_EXTRA_PATHS "")
set(POLLY_TEST_DEPS llvm-config opt LLVMPolly FileCheck not)
endif()
if (POLLY_BUNDLED_ISL)
list(APPEND POLLY_TEST_DEPS polly-isl-test)
endif()
if (POLLY_GTEST_AVAIL)
list(APPEND POLLY_TEST_DEPS PollyUnitTests)
endif ()
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
set(POLLY_LIB_DIR "${POLLY_BINARY_DIR}/lib")
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
# Run regression and unit tests
add_lit_testsuite(check-polly-tests "Running polly regression tests"
${CMAKE_CURRENT_BINARY_DIR}
PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
polly_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS ${POLLY_TEST_DEPS}
)
set_target_properties(check-polly-tests PROPERTIES FOLDER "Polly")
add_dependencies(check-polly check-polly-tests)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
)
if (POLLY_GTEST_AVAIL)
# Run only unit tests
add_lit_testsuite(check-polly-unittests "Running polly unit tests only"
${CMAKE_CURRENT_BINARY_DIR}/Unit
PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS PollyUnitTests
)
set_target_properties(check-polly-unittests PROPERTIES FOLDER "Polly")
endif ()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/UnitIsl/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg)
if (POLLY_BUNDLED_ISL)
add_lit_testsuite(check-polly-isl "Running isl unit tests only"
${CMAKE_CURRENT_BINARY_DIR}/UnitIsl
PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg
DEPENDS polly-isl-test
)
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly")
endif (POLLY_BUNDLED_ISL)
# Run polly-check-format as part of polly-check only if we are compiling with
# clang, so clang-format is available.
# if (TARGET clang-format) would be preferable, but this target is only added
# after Polly, i.e. there is no such target yet at this point. The CMake cache
# entry LLVM_TOOL_CLANG_BUILD will only be defined after clang has been
# configured at least once, i.e. format will be checked only after a rerun of
# CMake's configure.
if (LLVM_TOOL_CLANG_BUILD)
add_dependencies(check-polly polly-check-format)
endif ()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/update_check.py
${CMAKE_CURRENT_BINARY_DIR}/update_check.py)
# Add a legacy target spelling: polly-test
add_custom_target(polly-test)
set_target_properties(polly-test PROPERTIES FOLDER "Polly")
add_dependencies(polly-test check-polly)

View File

@@ -0,0 +1,34 @@
; RUN: opt %loadPolly -S -polly-codegen < %s | FileCheck %s
;
; Check that we generate code without crashing.
;
; CHECK: polly.start
;
target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
; Function Attrs: nounwind uwtable
define void @quux() unnamed_addr #0 {
bb:
br label %bb1
bb1: ; preds = %bb
%tmp = icmp eq i64 0, 0
br i1 %tmp, label %bb2, label %bb7
bb2: ; preds = %bb1
%tmp3 = icmp ult i64 4, 12
%tmp4 = zext i1 %tmp3 to i64
%tmp5 = tail call i64 @llvm.expect.i64(i64 %tmp4, i64 0)
%tmp6 = trunc i64 %tmp5 to i32
br label %bb7
bb7: ; preds = %bb2, %bb1
%tmp8 = phi i32 [ undef, %bb2 ], [ 0, %bb1 ]
ret void
}
; Function Attrs: nounwind readnone
declare i64 @llvm.expect.i64(i64, i64) #1
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind readnone }

View File

@@ -0,0 +1,59 @@
; RUN: opt %loadPolly -polly-opt-isl -polly-opt-max-coefficient=-1 -polly-parallel -polly-codegen -S < %s | FileCheck %s
;
; Check that we do not crash but generate parallel code
;
; CHECK: polly.par.setup
;
; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; Function Attrs: nounwind uwtable
define void @III_hybrid([32 x double]* %tsOut) #0 {
entry:
%0 = getelementptr inbounds [32 x double], [32 x double]* %tsOut, i64 0, i64 0
br label %if.end
if.end: ; preds = %entry
br i1 undef, label %for.body42, label %for.cond66.preheader
for.cond39.for.cond66.preheader.loopexit67_crit_edge: ; preds = %for.body42
%add.ptr62.lcssa = phi double* [ undef, %for.body42 ]
br label %for.cond66.preheader
for.cond66.preheader: ; preds = %for.cond39.for.cond66.preheader.loopexit67_crit_edge, %if.end
%rawout1.3.ph = phi double* [ %add.ptr62.lcssa, %for.cond39.for.cond66.preheader.loopexit67_crit_edge ], [ undef, %if.end ]
%sb.3.ph = phi i32 [ 0, %for.cond39.for.cond66.preheader.loopexit67_crit_edge ], [ 0, %if.end ]
%tspnt.3.ph = phi double* [ undef, %for.cond39.for.cond66.preheader.loopexit67_crit_edge ], [ %0, %if.end ]
br label %for.cond69.preheader
for.body42: ; preds = %if.end
br label %for.cond39.for.cond66.preheader.loopexit67_crit_edge
for.cond69.preheader: ; preds = %for.end76, %for.cond66.preheader
%tspnt.375 = phi double* [ %incdec.ptr79, %for.end76 ], [ %tspnt.3.ph, %for.cond66.preheader ]
%sb.374 = phi i32 [ %inc78, %for.end76 ], [ %sb.3.ph, %for.cond66.preheader ]
%rawout1.373 = phi double* [ undef, %for.end76 ], [ %rawout1.3.ph, %for.cond66.preheader ]
br label %for.body71
for.body71: ; preds = %for.body71, %for.cond69.preheader
%indvars.iv = phi i64 [ 0, %for.cond69.preheader ], [ %indvars.iv.next, %for.body71 ]
%rawout1.469 = phi double* [ %rawout1.373, %for.cond69.preheader ], [ undef, %for.body71 ]
%1 = bitcast double* %rawout1.469 to i64*
%2 = load i64, i64* %1, align 8
%3 = shl nsw i64 %indvars.iv, 5
%arrayidx73 = getelementptr inbounds double, double* %tspnt.375, i64 %3
%4 = bitcast double* %arrayidx73 to i64*
store i64 %2, i64* %4, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond = icmp ne i64 %indvars.iv.next, 18
br i1 %exitcond, label %for.body71, label %for.end76
for.end76: ; preds = %for.body71
%inc78 = add nsw i32 %sb.374, 1
%incdec.ptr79 = getelementptr inbounds double, double* %tspnt.375, i64 1
%exitcond95 = icmp ne i32 %inc78, 32
br i1 %exitcond95, label %for.cond69.preheader, label %for.end80
for.end80: ; preds = %for.end76
ret void
}

View File

@@ -0,0 +1,41 @@
; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-delicm -analyze < %s | FileCheck %s
; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-delicm -disable-output -pass-remarks-missed=polly-delicm < %s 2>&1 | FileCheck %s -check-prefix=REMARKS
;
; ForwardOptree changes the SCoP and may already map some accesses.
; DeLICM must be prepared to encounter implicit reads
; (isOriginalScalarKind()) that occur at the beginning of the SCoP
; to an array (isLatestArrayKind()). Otherwise it may confuse the
; MemoryAccess execution order.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @confused_order(double* nocapture %C, i32 %rows, i32 %cols) {
entry:
%0 = sext i32 %cols to i64
%1 = sext i32 %rows to i64
%cmp108 = icmp slt i64 0, %0
br i1 undef, label %for.body7.lr.ph, label %for.end103
for.body7.lr.ph:
br label %for.end103
for.end103:
%a_dot_b_domain.0.lcssa = phi double [ 0.000000e+00, %entry ], [ undef, %for.body7.lr.ph ]
%arrayidx107 = getelementptr inbounds double, double* %C, i64 0
store double %a_dot_b_domain.0.lcssa, double* %arrayidx107
%cmp109 = icmp slt i64 0, %1
%or.cond = and i1 %cmp108, %cmp109
br i1 %or.cond, label %if.then110, label %for.inc116
if.then110:
%arrayidx114 = getelementptr inbounds double, double* %C, i64 0
store double %a_dot_b_domain.0.lcssa, double* %arrayidx114
br label %for.inc116
for.inc116:
ret void
}
; REMARKS-NOT: load after store of same element in same statement
; CHECK: No modification has been made

View File

@@ -0,0 +1,47 @@
{
"arrays" : [
{
"name" : "MemRef_C",
"sizes" : [ "*" ],
"type" : "double"
}
],
"context" : "[cols, rows] -> { : -2147483648 <= cols <= 2147483647 and -2147483648 <= rows <= 2147483647 }",
"name" : "%for.end103---%for.inc116",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_a_dot_b_domain_0_lcssa__phi[] }"
},
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_C[0] }"
},
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_a_dot_b_domain_0_lcssa[] }"
}
],
"domain" : "[cols, rows] -> { Stmt_for_end103[] }",
"name" : "Stmt_for_end103",
"schedule" : "[cols, rows] -> { Stmt_for_end103[] -> [0] }"
},
{
"accesses" : [
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_if_then110[] -> MemRef_C[0] }"
},
{
"kind" : "read",
"relation" : "[cols, rows] -> { Stmt_if_then110[] -> MemRef_a_dot_b_domain_0_lcssa[] }"
}
],
"domain" : "[cols, rows] -> { Stmt_if_then110[] : cols > 0 and rows > 0 }",
"name" : "Stmt_if_then110",
"schedule" : "[cols, rows] -> { Stmt_if_then110[] -> [1] }"
}
]
}

View File

@@ -0,0 +1,47 @@
{
"arrays" : [
{
"name" : "MemRef_C",
"sizes" : [ "*" ],
"type" : "double"
}
],
"context" : "[cols, rows] -> { : -2147483648 <= cols <= 2147483647 and -2147483648 <= rows <= 2147483647 }",
"name" : "%for.end103---%for.inc116",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_a_dot_b_domain_0_lcssa__phi[] }"
},
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_C[0] }"
},
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_for_end103[] -> MemRef_a_dot_b_domain_0_lcssa[] }"
}
],
"domain" : "[cols, rows] -> { Stmt_for_end103[] }",
"name" : "Stmt_for_end103",
"schedule" : "[cols, rows] -> { Stmt_for_end103[] -> [0] }"
},
{
"accesses" : [
{
"kind" : "write",
"relation" : "[cols, rows] -> { Stmt_if_then110[] -> MemRef_C[0] }"
},
{
"kind" : "read",
"relation" : "[cols, rows] -> { Stmt_if_then110[] -> MemRef_C[0] }"
}
],
"domain" : "[cols, rows] -> { Stmt_if_then110[] : cols > 0 and rows > 0 }",
"name" : "Stmt_if_then110",
"schedule" : "[cols, rows] -> { Stmt_if_then110[] -> [1] }"
}
]
}

View File

@@ -0,0 +1,71 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck -match-full-lines %s
;
; Check that PHI mapping works even in presence of a memset whose'
; zero value is used.
;
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
define void @func(i8* noalias nonnull %A) {
entry:
br label %outer.for
outer.for:
%j = phi i32 [0, %entry], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %bodyA, label %outer.exit
bodyA:
%A_idx = getelementptr inbounds i8, i8* %A, i32 %j
%cond = icmp eq i32 21, 21
br i1 %cond, label %bodyB, label %bodyC
bodyB:
call void @llvm.memset.p0i8.i64(i8* %A_idx, i8 0, i64 1, i32 1, i1 false)
br label %bodyC
bodyC:
%phi = phi i8 [1, %bodyA], [0, %bodyB]
%a = load i8, i8* %A_idx
store i8 %phi, i8* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: Overwrites mapped to: 1
; CHECK: PHI scalars mapped: 1
; CHECK: }
; CHECK: After accesses {
; CHECK-NEXT: Stmt_bodyA
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_bodyA[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_bodyA[i0] -> MemRef_A[o0] : 1 = 0 };
; CHECK-NEXT: Stmt_bodyB
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_bodyB[i0] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_bodyB[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_bodyB[i0] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_bodyC
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_bodyC[i0] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_A[i0] };
; CHECK-NEXT: }

View File

@@ -0,0 +1,79 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi1 = 0.0, phi2 = 0.0;
; for (int i = 0; i < 4; i += 1) { /* reduction */
; phi1 += 4.2;
; phi2 += 29.0;
; }
; A[j] = phi1 + phi2;
; }
; }
;
; Check that we cannot map both, %phi1 and %phi2 to A[j] (conflict).
; Note that it is undefined which one will be mapped. We keep the test
; symmetric so it passes if either one is mapped.
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi1 = phi double [0.0, %reduction.preheader], [%add1, %reduction.inc]
%phi2 = phi double [0.0, %reduction.preheader], [%add2, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add1 = fadd double %phi1, 4.2
%add2 = fadd double %phi2, 29.0
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
%sum = fadd double %phi1, %phi2
store double %sum, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: Overwrites mapped to: 1
; CHECK: Value scalars mapped: 2
; CHECK: PHI scalars mapped: 1
; CHECK: }

View File

@@ -0,0 +1,78 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; fsomeval = 21.0 + 21.0;
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; A[j] = fsomeval;
; }
; g(fsomeval);
; }
;
; Check that fsomeval is not mapped to A[j] because it is escaping the SCoP.
; Supporting this would require reloading the scalar from A[j], and/or
; identifying the last instance of fsomeval that escapes.
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
%fsomeval = fadd double 21.0, 21.0
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
store double %fsomeval, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
call void @g(double %fsomeval)
ret void
}
declare void @g(double)
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,73 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; dummy = A[j];
; A[j] = phi;
; }
; }
;
; Check that A[j] is not used for mapping as it is still in use.
;
define void @func(double* noalias nonnull %A) {
entry:
%fsomeval = fadd double 21.0, 21.0
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
%dummy = load double, double* %A_idx
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,73 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; fsomeval = 21.0 + 21.0;
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; A[j] = fsomeval;
; }
; }
;
; Check that fsomeval is not mapped to A[j] because it is read-only.
; There is no advantage in mapping values not modified within the SCoP.
;
define void @func(double* noalias nonnull %A) {
entry:
%fsomeval = fadd double 21.0, 21.0
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
store double %fsomeval, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,84 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; if (phi < 0.0)
; A[j] = undef;
; A[j] = phi;
; }
; }
;
; The MAY_WRITE in reduction.exit.true avoids that anything can be mapped to
; A[j] because it would be overwritten by that MAY_WRITE just before the final
; MUST_WRITE. Also nothing can be map to the MAY_WRITE itself because it is a
; MAY_WRITE.
;
define void @func(double* noalias nonnull %A) {
entry:
%fsomeval = fadd double 21.0, 21.0
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
%phi.cmp = fcmp ogt double %phi, 0.0
br i1 %phi.cmp, label %reduction.exit.true, label %reduction.exit.unconditional
reduction.exit.true:
store double undef, double* %A_idx
br label %reduction.exit.unconditional
reduction.exit.unconditional:
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,72 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(float *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; A[j] = fsomeval;
; }
; }
;
; Check that %fphi is not mapped to A[j] because it is double-sized,
; but A[j] stores only floats.
;
define void @func(float* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds float, float* %A, i32 %j
%fphi = fptrunc double %phi to float
store float %fphi, float* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,88 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; if (phi < 0.0)
; A[j] = undef;
; phi += 4.2;
; A[j] = phi;
; }
; }
;
; The MAY_WRITE in reduction.for.true conflict with a write of %phi to
; A[j] if %phi would be mapped to it. Being a MAY_WRITE avoids being target
; of a mapping itself.
;
; TODO: There is actually no reason why these conflict. The MAY_WRITE is an
; explicit write, defined to occur always before all implicit writes as the
; write of %phi would be. There is currently no differentiation between
; implicit and explicit writes in Polly.
;
define void @func(double* noalias nonnull %A) {
entry:
%fsomeval = fadd double 21.0, 21.0
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%A_idx = getelementptr inbounds double, double* %A, i32 %j
%phi.cmp = fcmp ogt double %phi, 0.0
br i1 %phi.cmp, label %reduction.for.true, label %reduction.for.unconditional
reduction.for.true:
store double undef, double* %A_idx
br label %reduction.for.unconditional
reduction.for.unconditional:
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: Compatible overwrites: 1
; CHECK: }
; CHECK: No modification has been made

View File

@@ -0,0 +1,36 @@
; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
;
; Simple test for the existence of the DeLICM pass.
;
; // Simplest detected SCoP to run DeLICM on.
; for (int j = 0; j < n; j += 1) {
; body: A[0] = 0.0;
; }
;
define void @func(i32 %n, double* noalias nonnull %A) {
entry:
br label %for
for:
%j = phi i32 [0, %entry], [%j.inc, %inc]
%j.cmp = icmp slt i32 %j, %n
br i1 %j.cmp, label %body, label %exit
body:
store double 0.0, double* %A
br label %inc
inc:
%j.inc = add nuw nsw i32 %j, 1
br label %for
exit:
br label %return
return:
ret void
}
; Verify that the DeLICM has a custom printScop() function.
; CHECK: DeLICM result:

View File

@@ -0,0 +1,91 @@
; RUN: opt %loadPolly -polly-delicm-partial-writes=true -polly-delicm -analyze < %s | FileCheck -match-full-lines %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) /* reduction */
; phi += 4.2;
; A[j] = phi;
; }
; }
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.for
outer.for:
%j = phi i32 [0, %entry], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.for, label %outer.exit
reduction.for:
%i = phi i32 [0, %outer.for], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %outer.for], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: After accesses {
; CHECK-NEXT: Stmt_outer_for
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_outer_for[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_outer_for[i0] -> MemRef_A[i0] : i0 <= 1 };
; CHECK-NEXT: Stmt_reduction_for
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_body
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_inc
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_exit
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_reduction_exit[i0] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_exit[i0] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_reduction_exit[i0] -> MemRef_A[i0] };
; CHECK-NEXT: }

View File

@@ -0,0 +1,102 @@
; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-compute-known=true -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) { /* reduction */
; phi += 4.2;
; A[j] = phi;
; }
; A[j] = phi;
; }
; }
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
%i.cmp = icmp slt i32 %i, 4
%A_idx = getelementptr inbounds double, double* %A, i32 %j
br i1 %i.cmp, label %body, label %reduction.exit
body:
%add = fadd double %phi, 4.2
store double %add, double* %A_idx
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
br label %reduction.for
reduction.exit:
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: After accesses {
; CHECK-NEXT: Stmt_reduction_preheader
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_preheader[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_preheader[i0] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_for
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_body
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_inc
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : i1 <= 7 - 5i0; Stmt_reduction_inc[1, 3] -> MemRef_A[1] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_exit
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_reduction_exit[i0] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_exit[i0] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_reduction_exit[i0] -> MemRef_A[i0] };
; CHECK-NEXT: }

View File

@@ -0,0 +1,68 @@
; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm -analyze < %s | FileCheck %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; for (int i = 0; i < 4; i += 1) { /* reduction */
; double phi = A[j];
; phi += 4.2;
; A[j] = phi;
; }
; }
; }
;
; There is nothing to do in this case. All accesses are in %body.
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
br label %body
body:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
%val = load double, double* %A_idx
%add = fadd double %val, 4.2
store double %add, double* %A_idx
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
%i.cmp = icmp slt i32 %i.inc, 4
br i1 %i.cmp, label %reduction.for, label %reduction.exit
reduction.exit:
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: No modification has been made

View File

@@ -0,0 +1,80 @@
; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-overapproximate-writes=true -polly-delicm-compute-known=true -polly-delicm -analyze < %s | FileCheck %s
;
; Verify that delicm can cope with never taken PHI incoming edges.
; The edge %body -> %body_phi is never taken, hence the access MemoryKind::PHI,
; WRITE in %body for %phi is never used.
; When mapping %phi, the write's access relation is the empty set.
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; for (int i = 0; i < 4; i += 1) { /* reduction */
; double phi = 21.0;
; if (j < 10) // Tautology, since 0<=j<2
; phi = 42.0;
; }
; A[j] = phi;
; }
; }
;
define void @func(double* noalias nonnull %A, double* noalias nonnull %dummy) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
%A_idx = getelementptr inbounds double, double* %A, i32 %j
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
br label %body
body:
%cond = icmp slt i32 %j, 10
br i1 %cond, label %alwaystaken, label %body_phi
alwaystaken:
store double 0.0, double* %dummy
br label %body_phi
body_phi:
%phi = phi double [21.0, %body], [42.0, %alwaystaken]
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
%i.cmp = icmp slt i32 %i.inc, 4
br i1 %i.cmp, label %reduction.for, label %reduction.exit
reduction.exit:
store double %phi, double* %A_idx
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: Statistics {
; CHECK: PHI scalars mapped: 1
; CHECK: }

View File

@@ -0,0 +1,126 @@
; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-overapproximate-writes=true -polly-delicm-compute-known=true -polly-delicm -analyze < %s | FileCheck %s
; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-partial-writes=true -polly-delicm-compute-known=true -polly-delicm -analyze < %s | FileCheck -check-prefix=PARTIAL %s
;
; void func(double *A) {
; for (int j = 0; j < 2; j += 1) { /* outer */
; double phi = 0.0;
; for (int i = 0; i < 4; i += 1) { /* reduction */
; phi += 4.2;
; A[j] = phi;
; }
; }
; }
;
define void @func(double* noalias nonnull %A) {
entry:
br label %outer.preheader
outer.preheader:
br label %outer.for
outer.for:
%j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
%j.cmp = icmp slt i32 %j, 2
br i1 %j.cmp, label %reduction.preheader, label %outer.exit
reduction.preheader:
br label %reduction.for
reduction.for:
%i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
%phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
br label %body
body:
%add = fadd double %phi, 4.2
%A_idx = getelementptr inbounds double, double* %A, i32 %j
store double %add, double* %A_idx
br label %reduction.inc
reduction.inc:
%i.inc = add nuw nsw i32 %i, 1
%i.cmp = icmp slt i32 %i.inc, 4
br i1 %i.cmp, label %reduction.for, label %reduction.exit
reduction.exit:
br label %outer.inc
outer.inc:
%j.inc = add nuw nsw i32 %j, 1
br label %outer.for
outer.exit:
br label %return
return:
ret void
}
; CHECK: After accesses {
; CHECK-NEXT: Stmt_reduction_preheader
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_preheader[i0] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_preheader[i0] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_for
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_body
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_phi[] };
; CHECK-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] : 3i1 <= 21 - 13i0; Stmt_body[1, 3] -> MemRef_A[1] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_reduction_inc
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_add[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : 3i1 <= 21 - 13i0; Stmt_reduction_inc[1, 3] -> MemRef_A[1] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_phi__phi[] };
; CHECK-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] };
; CHECK-NEXT: }
; PARTIAL: After accesses {
; PARTIAL-NEXT: Stmt_reduction_preheader
; PARTIAL-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_reduction_preheader[i0] -> MemRef_phi__phi[] };
; PARTIAL-NEXT: new: { Stmt_reduction_preheader[i0] -> MemRef_A[i0] };
; PARTIAL-NEXT: Stmt_reduction_for
; PARTIAL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi__phi[] };
; PARTIAL-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; PARTIAL-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_reduction_for[i0, i1] -> MemRef_phi[] };
; PARTIAL-NEXT: new: { Stmt_reduction_for[i0, i1] -> MemRef_A[i0] };
; PARTIAL-NEXT: Stmt_body
; PARTIAL-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_body[i0, i1] -> MemRef_add[] };
; PARTIAL-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; PARTIAL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_body[i0, i1] -> MemRef_phi[] };
; PARTIAL-NEXT: new: { Stmt_body[i0, i1] -> MemRef_A[i0] : 3i1 <= 21 - 13i0; Stmt_body[1, 3] -> MemRef_A[1] };
; PARTIAL-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; PARTIAL-NEXT: { Stmt_body[i0, i1] -> MemRef_A[i0] };
; PARTIAL-NEXT: Stmt_reduction_inc
; PARTIAL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_add[] };
; PARTIAL-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : 3i1 <= 21 - 13i0; Stmt_reduction_inc[1, 3] -> MemRef_A[1] };
; PARTIAL-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
; PARTIAL-NEXT: { Stmt_reduction_inc[i0, i1] -> MemRef_phi__phi[] };
; PARTIAL-NEXT: new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[i0] : i1 <= 2 };
; PARTIAL-NEXT: }

Some files were not shown because too many files have changed in this diff Show More