forked from OSchip/llvm-project
[Refactor] Make the used dependence types explicit
llvm-svn: 211803
This commit is contained in:
parent
1da044a4da
commit
1530adffdd
|
@ -47,11 +47,11 @@ public:
|
||||||
|
|
||||||
/// @brief The type of the dependences.
|
/// @brief The type of the dependences.
|
||||||
///
|
///
|
||||||
/// Reduction dependences are not included in TYPE_ALL dependences because we
|
/// Reduction dependences are seperated because they can be ignored during
|
||||||
/// can ignore them during the scheduling. This is the case since the order in
|
/// the scheduling. This is the case since the order in which the reduction
|
||||||
/// which the reduction statements are executed does not matter. However, if
|
/// statements are executed does not matter. However, if they are executed
|
||||||
/// they are executed in parallel we need to take additional measures (e.g.,
|
/// in parallel we need to take additional measures (e.g., privatization)
|
||||||
/// privatization) to ensure a correct result.
|
/// to ensure a correct result.
|
||||||
enum Type {
|
enum Type {
|
||||||
// Write after read
|
// Write after read
|
||||||
TYPE_WAR = 0x1,
|
TYPE_WAR = 0x1,
|
||||||
|
@ -64,9 +64,6 @@ public:
|
||||||
|
|
||||||
// Reduction dependences
|
// Reduction dependences
|
||||||
TYPE_RED = 0x8,
|
TYPE_RED = 0x8,
|
||||||
|
|
||||||
// All (validity) dependences
|
|
||||||
TYPE_ALL = (TYPE_WAR | TYPE_RAW | TYPE_WAW)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<ScopStmt *, isl_map *> StatementToIslMapTy;
|
typedef std::map<ScopStmt *, isl_map *> StatementToIslMapTy;
|
||||||
|
|
|
@ -369,7 +369,7 @@ bool Dependences::isValidScattering(StatementToIslMapTy *NewScattering) {
|
||||||
if (LegalityCheckDisabled)
|
if (LegalityCheckDisabled)
|
||||||
return true;
|
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_space *Space = S.getParamSpace();
|
||||||
isl_union_map *Scattering = isl_union_map_empty(Space);
|
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
|
// FIXME: We can remove ignore reduction dependences in case we privatize the
|
||||||
// memory locations the reduction statements reduce into.
|
// 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)) {
|
if (isl_union_map_is_empty(Deps)) {
|
||||||
isl_union_map_free(Deps);
|
isl_union_map_free(Deps);
|
||||||
|
|
|
@ -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
|
// FIXME: We can remove ignore reduction dependences in case we privatize the
|
||||||
// memory locations the reduction statements reduce into.
|
// 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_range(Deps, isl_union_map_copy(Schedule));
|
||||||
Deps = isl_union_map_apply_domain(Deps, Schedule);
|
Deps = isl_union_map_apply_domain(Deps, Schedule);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue