AccessStorageAnalysis: ignore _swift_stdlib_malloc_size and _swift_stdlib_has_malloc_size runtime calls

Those runtime calls are used in the Array implementation and prevented access optimizations.

rdar://87853551
This commit is contained in:
Erik Eckstein
2022-07-14 11:53:41 +02:00
parent 4967854e25
commit 96f16e008e
4 changed files with 38 additions and 8 deletions

View File

@@ -380,6 +380,19 @@ bool FunctionAccessStorage::summarizeFunction(SILFunction *F) {
return true;
}
bool FunctionAccessStorage::summarizeCall(FullApplySite fullApply) {
assert(accessResult.isEmpty() && "expected uninitialized results.");
if (SILFunction *callee = fullApply.getReferencedFunctionOrNull()) {
if (callee->getName() == "_swift_stdlib_malloc_size" ||
callee->getName() == "_swift_stdlib_has_malloc_size") {
return true;
}
}
return false;
}
SILAnalysis *swift::createAccessStorageAnalysis(SILModule *) {
return new AccessStorageAnalysis();
}