Skip to content

Commit 6f2cda1

Browse files
committed
Add AccessUseVisitor and cleanup related APIs.
Add AccesssedStorage::compute and computeInScope to mirror AccessPath. Allow recovering the begin_access for Nested storage. Adds AccessedStorage.visitRoots().
1 parent 9c69d02 commit 6f2cda1

File tree

18 files changed

+904
-484
lines changed

18 files changed

+904
-484
lines changed

include/swift/SIL/MemAccessUtils.h

Lines changed: 221 additions & 97 deletions
Large diffs are not rendered by default.

include/swift/SILOptimizer/Analysis/ValueTracking.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool pointsToLocalObject(SILValue V);
5959
inline bool isUniquelyIdentified(SILValue V) {
6060
SILValue objectRef = V;
6161
if (V->getType().isAddress()) {
62-
auto storage = findAccessedStorage(V);
62+
auto storage = AccessedStorage::compute(V);
6363
if (!storage)
6464
return false;
6565

lib/IRGen/IRGenSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4125,7 +4125,7 @@ void IRGenSILFunction::visitRefTailAddrInst(RefTailAddrInst *i) {
41254125
}
41264126

41274127
static bool isInvariantAddress(SILValue v) {
4128-
SILValue accessedAddress = getAccessAddress(v);
4128+
SILValue accessedAddress = getTypedAccessAddress(v);
41294129
if (auto *ptrRoot = dyn_cast<PointerToAddressInst>(accessedAddress)) {
41304130
return ptrRoot->isInvariant();
41314131
}

0 commit comments

Comments
 (0)