[MemorySSA] Assert defining access is not a MemoryUse.

This commit is contained in:
Alina Sbirlea 2020-08-27 16:39:53 -07:00
parent e6870b67d6
commit ee5e19fe38

View File

@ -1726,8 +1726,11 @@ MemoryUseOrDef *MemorySSA::createDefinedAccess(Instruction *I,
if (CreationMustSucceed)
assert(NewAccess != nullptr && "Tried to create a memory access for a "
"non-memory touching instruction");
if (NewAccess)
if (NewAccess) {
assert((!Definition || !isa<MemoryUse>(Definition)) &&
"A use cannot be a defining access");
NewAccess->setDefiningAccess(Definition);
}
return NewAccess;
}