[polly] r310814 - [Polly] Move Scop::restrictDomains to islpp. NFC.
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 23:49:01 PDT 2017
Author: grosser
Date: Sun Aug 13 23:49:01 2017
New Revision: 310814
URL: http://llvm.org/viewvc/llvm-project?rev=310814&view=rev
Log:
[Polly] Move Scop::restrictDomains to islpp. NFC.
Reviewers: grosser, Meinersbur, bollu
Differential Revision: https://reviews.llvm.org/D36659
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/lib/Transform/DeadCodeElimination.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=310814&r1=310813&r2=310814&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug 13 23:49:01 2017
@@ -2935,7 +2935,7 @@ public:
/// Intersects the domains of all statements in the SCoP.
///
/// @return true if a change was made
- bool restrictDomains(__isl_take isl_union_set *Domain);
+ bool restrictDomains(isl::union_set Domain);
/// Get the depth of a loop relative to the outermost loop in the Scop.
///
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=310814&r1=310813&r2=310814&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug 13 23:49:01 2017
@@ -4766,32 +4766,24 @@ void Scop::setScheduleTree(__isl_take is
Schedule = NewSchedule;
}
-bool Scop::restrictDomains(__isl_take isl_union_set *Domain) {
+bool Scop::restrictDomains(isl::union_set Domain) {
bool Changed = false;
for (ScopStmt &Stmt : *this) {
- isl_union_set *StmtDomain =
- isl_union_set_from_set(Stmt.getDomain().release());
- isl_union_set *NewStmtDomain = isl_union_set_intersect(
- isl_union_set_copy(StmtDomain), isl_union_set_copy(Domain));
-
- if (isl_union_set_is_subset(StmtDomain, NewStmtDomain)) {
- isl_union_set_free(StmtDomain);
- isl_union_set_free(NewStmtDomain);
+ isl::union_set StmtDomain = isl::union_set(Stmt.getDomain());
+ isl::union_set NewStmtDomain = StmtDomain.intersect(Domain);
+
+ if (StmtDomain.is_subset(NewStmtDomain))
continue;
- }
Changed = true;
- isl_union_set_free(StmtDomain);
- NewStmtDomain = isl_union_set_coalesce(NewStmtDomain);
+ NewStmtDomain = NewStmtDomain.coalesce();
- if (isl_union_set_is_empty(NewStmtDomain)) {
+ if (NewStmtDomain.is_empty())
Stmt.restrictDomain(isl::set::empty(Stmt.getDomainSpace()));
- isl_union_set_free(NewStmtDomain);
- } else
- Stmt.restrictDomain(isl::manage(isl_set_from_union_set(NewStmtDomain)));
+ else
+ Stmt.restrictDomain(isl::set(NewStmtDomain));
}
- isl_union_set_free(Domain);
return Changed;
}
Modified: polly/trunk/lib/Transform/DeadCodeElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/DeadCodeElimination.cpp?rev=310814&r1=310813&r2=310814&view=diff
==============================================================================
--- polly/trunk/lib/Transform/DeadCodeElimination.cpp (original)
+++ polly/trunk/lib/Transform/DeadCodeElimination.cpp Sun Aug 13 23:49:01 2017
@@ -154,7 +154,7 @@ bool DeadCodeElim::eliminateDeadCode(Sco
Live = Live.coalesce();
- bool Changed = S.restrictDomains(Live.copy());
+ bool Changed = S.restrictDomains(Live);
// FIXME: We can probably avoid the recomputation of all dependences by
// updating them explicitly.
More information about the llvm-commits
mailing list