ScopInfo: Ensure copy statement memory accesses are correct

Add asserts that verify that the memory accesses of a new copy statement
are defined for all domain instances the copy statement is defined for.

llvm-svn: 286047
This commit is contained in:
Tobias Grosser 2016-11-05 21:02:43 +00:00
parent a4e56fb569
commit 744740ad91
1 changed files with 8 additions and 0 deletions

View File

@ -4153,6 +4153,14 @@ void Scop::addScopStmt(BasicBlock *BB, Region *R) {
ScopStmt *Scop::addScopStmt(__isl_take isl_map *SourceRel,
__isl_take isl_map *TargetRel,
__isl_take isl_set *Domain) {
isl_set *SourceDomain = isl_map_domain(isl_map_copy(SourceRel));
isl_set *TargetDomain = isl_map_domain(isl_map_copy(TargetRel));
assert(isl_set_is_subset(Domain, TargetDomain) &&
"Target access not defined for complete statement domain");
assert(isl_set_is_subset(Domain, SourceDomain) &&
"Source access not defined for complete statement domain");
isl_set_free(SourceDomain);
isl_set_free(TargetDomain);
Stmts.emplace_back(*this, SourceRel, TargetRel, Domain);
CopyStmtsNum++;
return &(Stmts.back());