mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-05 00:49:43 +00:00
getDependences to new C++ interface
Reviewers: Meinersbur, grosser, bollu, cs15btech11044, jdoerfert Reviewed By: grosser Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D47786 llvm-svn: 334092
This commit is contained in:
parent
0c9e1c8d61
commit
6a6d9df78e
@ -99,7 +99,7 @@ struct Dependences {
|
||||
/// @param Kinds This integer defines the different kinds of dependences
|
||||
/// that will be returned. To return more than one kind, the
|
||||
/// different kinds are 'ored' together.
|
||||
__isl_give isl_union_map *getDependences(int Kinds) const;
|
||||
isl::union_map getDependences(int Kinds) const;
|
||||
|
||||
/// Report if valid dependences are available.
|
||||
bool hasValidDependences() const;
|
||||
|
@ -736,7 +736,8 @@ bool Dependences::isValidSchedule(Scop &S,
|
||||
if (LegalityCheckDisabled)
|
||||
return true;
|
||||
|
||||
isl_union_map *Dependences = getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR);
|
||||
isl_union_map *Dependences =
|
||||
(getDependences(TYPE_RAW | TYPE_WAW | TYPE_WAR)).release();
|
||||
isl_space *Space = S.getParamSpace().release();
|
||||
isl_union_map *Schedule = isl_union_map_empty(Space);
|
||||
|
||||
@ -874,28 +875,28 @@ void Dependences::releaseMemory() {
|
||||
ReductionDependences.clear();
|
||||
}
|
||||
|
||||
__isl_give isl_union_map *Dependences::getDependences(int Kinds) const {
|
||||
isl::union_map Dependences::getDependences(int Kinds) const {
|
||||
assert(hasValidDependences() && "No valid dependences available");
|
||||
isl_space *Space = isl_union_map_get_space(RAW);
|
||||
isl_union_map *Deps = isl_union_map_empty(Space);
|
||||
isl::space Space = isl::manage_copy(RAW).get_space();
|
||||
isl::union_map Deps = Deps.empty(Space);
|
||||
|
||||
if (Kinds & TYPE_RAW)
|
||||
Deps = isl_union_map_union(Deps, isl_union_map_copy(RAW));
|
||||
Deps = Deps.unite(isl::manage_copy(RAW));
|
||||
|
||||
if (Kinds & TYPE_WAR)
|
||||
Deps = isl_union_map_union(Deps, isl_union_map_copy(WAR));
|
||||
Deps = Deps.unite(isl::manage_copy(WAR));
|
||||
|
||||
if (Kinds & TYPE_WAW)
|
||||
Deps = isl_union_map_union(Deps, isl_union_map_copy(WAW));
|
||||
Deps = Deps.unite(isl::manage_copy(WAW));
|
||||
|
||||
if (Kinds & TYPE_RED)
|
||||
Deps = isl_union_map_union(Deps, isl_union_map_copy(RED));
|
||||
Deps = Deps.unite(isl::manage_copy(RED));
|
||||
|
||||
if (Kinds & TYPE_TC_RED)
|
||||
Deps = isl_union_map_union(Deps, isl_union_map_copy(TC_RED));
|
||||
Deps = Deps.unite(isl::manage_copy(TC_RED));
|
||||
|
||||
Deps = isl_union_map_coalesce(Deps);
|
||||
Deps = isl_union_map_detect_equalities(Deps);
|
||||
Deps = Deps.coalesce();
|
||||
Deps = Deps.detect_equalities();
|
||||
return Deps;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,9 @@ bool PolyhedralInfo::checkParallel(Loop *L, isl_pw_aff **MinDepDistPtr) const {
|
||||
|
||||
isl_union_map *Deps =
|
||||
D.getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW |
|
||||
Dependences::TYPE_WAR | Dependences::TYPE_RED);
|
||||
Dependences::TYPE_WAR | Dependences::TYPE_RED)
|
||||
.release();
|
||||
|
||||
LLVM_DEBUG(dbgs() << "Dependences :\t" << stringFromIslObj(Deps) << "\n");
|
||||
|
||||
isl_union_map *Schedule = getScheduleForLoop(S, L);
|
||||
|
@ -216,19 +216,23 @@ static bool astScheduleDimIsParallel(__isl_keep isl_ast_build *Build,
|
||||
return false;
|
||||
|
||||
isl_union_map *Schedule = isl_ast_build_get_schedule(Build);
|
||||
isl_union_map *Deps = D->getDependences(
|
||||
Dependences::TYPE_RAW | Dependences::TYPE_WAW | Dependences::TYPE_WAR);
|
||||
isl_union_map *Deps =
|
||||
D->getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW |
|
||||
Dependences::TYPE_WAR)
|
||||
.release();
|
||||
|
||||
if (!D->isParallel(Schedule, Deps)) {
|
||||
isl_union_map *DepsAll =
|
||||
D->getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW |
|
||||
Dependences::TYPE_WAR | Dependences::TYPE_TC_RED);
|
||||
Dependences::TYPE_WAR | Dependences::TYPE_TC_RED)
|
||||
.release();
|
||||
D->isParallel(Schedule, DepsAll, &NodeInfo->MinimalDependenceDistance);
|
||||
isl_union_map_free(Schedule);
|
||||
return false;
|
||||
}
|
||||
|
||||
isl_union_map *RedDeps = D->getDependences(Dependences::TYPE_TC_RED);
|
||||
isl_union_map *RedDeps =
|
||||
D->getDependences(Dependences::TYPE_TC_RED).release();
|
||||
if (!D->isParallel(Schedule, RedDeps))
|
||||
NodeInfo->IsReductionParallel = true;
|
||||
|
||||
|
@ -124,8 +124,8 @@ bool DeadCodeElim::eliminateDeadCode(Scop &S, int PreciseSteps) {
|
||||
return false;
|
||||
|
||||
isl::union_set Live = getLiveOut(S);
|
||||
isl::union_map Dep = isl::manage(
|
||||
D.getDependences(Dependences::TYPE_RAW | Dependences::TYPE_RED));
|
||||
isl::union_map Dep =
|
||||
D.getDependences(Dependences::TYPE_RAW | Dependences::TYPE_RED);
|
||||
Dep = Dep.reverse();
|
||||
|
||||
if (PreciseSteps == -1)
|
||||
|
@ -444,7 +444,7 @@ bool MaximalStaticExpander::runOnScop(Scop &S) {
|
||||
// Get the RAW Dependences.
|
||||
auto &DI = getAnalysis<DependenceInfo>();
|
||||
auto &D = DI.getDependences(Dependences::AL_Reference);
|
||||
auto Dependences = isl::manage(D.getDependences(Dependences::TYPE_RAW));
|
||||
isl::union_map Dependences = D.getDependences(Dependences::TYPE_RAW);
|
||||
|
||||
SmallVector<ScopArrayInfo *, 4> CurrentSAI(S.arrays().begin(),
|
||||
S.arrays().end());
|
||||
|
@ -728,8 +728,8 @@ static bool containsOnlyMatrMultAcc(isl::map PartialSchedule,
|
||||
/// and false, otherwise.
|
||||
static bool containsOnlyMatMulDep(isl::map Schedule, const Dependences *D,
|
||||
int &Pos) {
|
||||
auto Dep = isl::manage(D->getDependences(Dependences::TYPE_RAW));
|
||||
auto Red = isl::manage(D->getDependences(Dependences::TYPE_RED));
|
||||
isl::union_map Dep = D->getDependences(Dependences::TYPE_RAW);
|
||||
isl::union_map Red = D->getDependences(Dependences::TYPE_RED);
|
||||
if (Red)
|
||||
Dep = Dep.unite(Red);
|
||||
auto DomainSpace = Schedule.get_space().domain();
|
||||
@ -1518,8 +1518,8 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
|
||||
ScopsProcessed++;
|
||||
walkScheduleTreeForStatistics(S.getScheduleTree(), 0);
|
||||
|
||||
isl::union_map Validity = isl::manage(D.getDependences(ValidityKinds));
|
||||
isl::union_map Proximity = isl::manage(D.getDependences(ProximityKinds));
|
||||
isl::union_map Validity = D.getDependences(ValidityKinds);
|
||||
isl::union_map Proximity = D.getDependences(ProximityKinds);
|
||||
|
||||
// Simplify the dependences by removing the constraints introduced by the
|
||||
// domains. This can speed up the scheduling time significantly, as large
|
||||
|
Loading…
x
Reference in New Issue
Block a user