[MemAccessUtils] Visit access as unique storage uses.

Add a new member functino UniqueStorageUseVisitor::visitBeginAccess and
call it when GatherUniqueStorageUses runs.
This commit is contained in:
Nate Chandler
2022-02-15 21:42:30 -08:00
parent ffea048bab
commit d227cef874
3 changed files with 18 additions and 2 deletions

View File

@@ -1098,7 +1098,6 @@ public:
// ignores its subclass bits.
AccessPath(AccessStorage storage, PathNode pathNode, int offset)
: storage(storage), pathNode(pathNode), offset(offset) {
assert(storage.getKind() != AccessStorage::Nested);
assert(pathNode.isValid() || !storage && "Access path requires a pathNode");
}
@@ -1337,6 +1336,7 @@ namespace swift {
/// to the storage within this function is derived from these roots.
///
/// Gather the kinds of uses that are typically relevant to algorithms:
/// - accesses (specifically, begin_access insts)
/// - loads (including copies out of, not including inout args)
/// - stores (including copies into and inout args)
/// - destroys (of the entire aggregate)
@@ -1353,6 +1353,7 @@ struct UniqueStorageUseVisitor {
virtual ~UniqueStorageUseVisitor() = default;
virtual bool visitBeginAccess(Operand *use) = 0;
virtual bool visitLoad(Operand *use) = 0;
virtual bool visitStore(Operand *use) = 0;
virtual bool visitDestroy(Operand *use) = 0;