mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-27 02:09:54 +00:00
[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:
parent
2a80cc688a
commit
77394f1394
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user