From 1530adffdda179d06faa7fdf4539afaa7896b891 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Thu, 26 Jun 2014 20:24:17 +0000 Subject: [PATCH] [Refactor] Make the used dependence types explicit llvm-svn: 211803 --- polly/include/polly/Dependences.h | 13 +++++-------- polly/lib/Analysis/Dependences.cpp | 4 ++-- polly/lib/CodeGen/IslAst.cpp | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/polly/include/polly/Dependences.h b/polly/include/polly/Dependences.h index 5be1ba7..5b09ab9 100755 --- a/polly/include/polly/Dependences.h +++ b/polly/include/polly/Dependences.h @@ -47,11 +47,11 @@ public: /// @brief The type of the dependences. /// - /// Reduction dependences are not included in TYPE_ALL dependences because we - /// can ignore them during the scheduling. This is the case since the order in - /// which the reduction statements are executed does not matter. However, if - /// they are executed in parallel we need to take additional measures (e.g., - /// privatization) to ensure a correct result. + /// Reduction dependences are seperated because they can be ignored during + /// the scheduling. This is the case since the order in which the reduction + /// statements are executed does not matter. However, if they are executed + /// in parallel we need to take additional measures (e.g., privatization) + /// to ensure a correct result. enum Type { // Write after read TYPE_WAR = 0x1, @@ -64,9 +64,6 @@ public: // Reduction dependences TYPE_RED = 0x8, - - // All (validity) dependences - TYPE_ALL = (TYPE_WAR | TYPE_RAW | TYPE_WAW) }; typedef std::map StatementToIslMapTy; diff --git a/polly/lib/Analysis/Dependences.cpp b/polly/lib/Analysis/Dependences.cpp index 37be06c..0390409 100644 --- a/polly/lib/Analysis/Dependences.cpp +++ b/polly/lib/Analysis/Dependences.cpp @@ -369,7 +369,7 @@ bool Dependences::isValidScattering(StatementToIslMapTy *NewScattering) { if (LegalityCheckDisabled) return true; - isl_union_map *Dependences = getDependences(TYPE_ALL); + isl_union_map *Dependences = getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR); isl_space *Space = S.getParamSpace(); isl_union_map *Scattering = isl_union_map_empty(Space); @@ -442,7 +442,7 @@ bool Dependences::isParallelDimension(__isl_take isl_set *ScheduleSubset, // FIXME: We can remove ignore reduction dependences in case we privatize the // memory locations the reduction statements reduce into. - Deps = getDependences(TYPE_ALL | TYPE_RED); + Deps = getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR | TYPE_RED); if (isl_union_map_is_empty(Deps)) { isl_union_map_free(Deps); diff --git a/polly/lib/CodeGen/IslAst.cpp b/polly/lib/CodeGen/IslAst.cpp index 57814e4..b31f7dc 100644 --- a/polly/lib/CodeGen/IslAst.cpp +++ b/polly/lib/CodeGen/IslAst.cpp @@ -168,7 +168,8 @@ static bool astScheduleDimIsParallel(__isl_keep isl_ast_build *Build, // FIXME: We can remove ignore reduction dependences in case we privatize the // memory locations the reduction statements reduce into. - Deps = D->getDependences(Dependences::TYPE_ALL | Dependences::TYPE_RED); + Deps = D->getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW | + Dependences::TYPE_WAR | Dependences::TYPE_RED); Deps = isl_union_map_apply_range(Deps, isl_union_map_copy(Schedule)); Deps = isl_union_map_apply_domain(Deps, Schedule); -- 2.7.4