[CodeGen] Add assertion for partial scalar accesses. NFC.

The code generator always adds unconditional LoadInst and StoreInst, hence the
MemoryAccess must be defined over all statement instances.

llvm-svn: 282853
This commit is contained in:
Michael Kruse 2016-09-30 14:01:46 +00:00
parent 2a80cc688a
commit 77394f1394

View File

@ -452,6 +452,15 @@ void BlockGenerator::generateScalarLoads(
if (MA->isOriginalArrayKind() || MA->isWrite())
continue;
#ifndef NDEBUG
auto *StmtDom = Stmt.getDomain();
auto *AccDom = isl_map_domain(MA->getAccessRelation());
assert(isl_set_is_subset(StmtDom, AccDom) &&
"Scalar must be loaded in all statement instances");
isl_set_free(StmtDom);
isl_set_free(AccDom);
#endif
auto *Address =
getImplicitAddress(*MA, getLoopForStmt(Stmt), LTS, BBMap, NewAccesses);
assert((!isa<Instruction>(Address) ||
@ -476,6 +485,15 @@ void BlockGenerator::generateScalarStores(
if (MA->isOriginalArrayKind() || MA->isRead())
continue;
#ifndef NDEBUG
auto *StmtDom = Stmt.getDomain();
auto *AccDom = isl_map_domain(MA->getAccessRelation());
assert(isl_set_is_subset(StmtDom, AccDom) &&
"Scalar must be stored in all statement instances");
isl_set_free(StmtDom);
isl_set_free(AccDom);
#endif
Value *Val = MA->getAccessValue();
if (MA->isAnyPHIKind()) {
assert(MA->getIncoming().size() >= 1 &&