[polly] r303611 - [ScopInfo] Translate assumeNoOutOfBound to isl C++ [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Tue May 23 00:07:07 PDT 2017
Author: grosser
Date: Tue May 23 02:07:07 2017
New Revision: 303611
URL: http://llvm.org/viewvc/llvm-project?rev=303611&view=rev
Log:
[ScopInfo] Translate assumeNoOutOfBound to isl C++ [NFC]
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=303611&r1=303610&r2=303611&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue May 23 02:07:07 2017
@@ -735,46 +735,39 @@ void MemoryAccess::assumeNoOutOfBound()
if (PollyIgnoreInbounds)
return;
auto *SAI = getScopArrayInfo();
- isl_space *Space = isl_space_range(getOriginalAccessRelationSpace());
- isl_set *Outside = isl_set_empty(isl_space_copy(Space));
- for (int i = 1, Size = isl_space_dim(Space, isl_dim_set); i < Size; ++i) {
- isl_local_space *LS = isl_local_space_from_space(isl_space_copy(Space));
- isl_pw_aff *Var =
- isl_pw_aff_var_on_domain(isl_local_space_copy(LS), isl_dim_set, i);
- isl_pw_aff *Zero = isl_pw_aff_zero_on_domain(LS);
+ isl::space Space = give(getOriginalAccessRelationSpace()).range();
+ isl::set Outside = isl::set::empty(Space);
+ for (int i = 1, Size = Space.dim(isl::dim::set); i < Size; ++i) {
+ isl::local_space LS(Space);
+ isl::pw_aff Var = isl::pw_aff::var_on_domain(LS, isl::dim::set, i);
+ isl::pw_aff Zero = isl::pw_aff(LS);
+
+ isl::set DimOutside = Var.lt_set(Zero);
+ isl::pw_aff SizeE = give(SAI->getDimensionSizePw(i));
+ SizeE = SizeE.add_dims(isl::dim::in, Space.dim(isl::dim::set));
+ SizeE = SizeE.set_tuple_id(isl::dim::in, Space.get_tuple_id(isl::dim::set));
+ DimOutside = DimOutside.unite(SizeE.le_set(Var));
- isl_set *DimOutside;
-
- DimOutside = isl_pw_aff_lt_set(isl_pw_aff_copy(Var), Zero);
- isl_pw_aff *SizeE = SAI->getDimensionSizePw(i);
- SizeE = isl_pw_aff_add_dims(SizeE, isl_dim_in,
- isl_space_dim(Space, isl_dim_set));
- SizeE = isl_pw_aff_set_tuple_id(SizeE, isl_dim_in,
- isl_space_get_tuple_id(Space, isl_dim_set));
-
- DimOutside = isl_set_union(DimOutside, isl_pw_aff_le_set(SizeE, Var));
-
- Outside = isl_set_union(Outside, DimOutside);
+ Outside = Outside.unite(DimOutside);
}
- Outside = isl_set_apply(Outside, isl_map_reverse(getAccessRelation()));
- Outside = isl_set_intersect(Outside, Statement->getDomain());
- Outside = isl_set_params(Outside);
+ Outside = Outside.apply(give(getAccessRelation()).reverse());
+ Outside = Outside.intersect(give(Statement->getDomain()));
+ Outside = Outside.params();
// Remove divs to avoid the construction of overly complicated assumptions.
// Doing so increases the set of parameter combinations that are assumed to
// not appear. This is always save, but may make the resulting run-time check
// bail out more often than strictly necessary.
- Outside = isl_set_remove_divs(Outside);
- Outside = isl_set_complement(Outside);
+ Outside = Outside.remove_divs();
+ Outside = Outside.complement();
const auto &Loc = getAccessInstruction()
? getAccessInstruction()->getDebugLoc()
: DebugLoc();
if (!PollyPreciseInbounds)
- Outside = isl_set_gist(Outside, isl_set_params(Statement->getDomain()));
- Statement->getParent()->recordAssumption(INBOUNDS, Outside, Loc,
+ Outside = Outside.gist_params(give(Statement->getDomain()).params());
+ Statement->getParent()->recordAssumption(INBOUNDS, Outside.release(), Loc,
AS_ASSUMPTION);
- isl_space_free(Space);
}
void MemoryAccess::buildMemIntrinsicAccessRelation() {
More information about the llvm-commits
mailing list