Merge pull request #84763 from nate-chandler/cherrypick/release/6.2/rdar161606892_2

6.2: [VariadicGenerics] Fix memeffect of metadata accessor.
This commit is contained in:
nate-chandler
2025-10-08 15:36:36 -07:00
committed by GitHub
7 changed files with 66 additions and 13 deletions

View File

@@ -750,7 +750,7 @@ static MetadataResponse emitNominalMetadataRef(IRGenFunction &IGF,
theDecl, genericArgs.Types, NotForDefinition);
response = IGF.emitGenericTypeMetadataAccessFunctionCall(
accessor, genericArgs.Values, request);
accessor, genericArgs.Values, request, genericArgs.hasPacks);
}
IGF.setScopedLocalTypeMetadata(theType, response);
@@ -2467,11 +2467,9 @@ void irgen::emitCacheAccessFunction(IRGenModule &IGM, llvm::Function *accessor,
IGF.Builder.CreateRet(ret);
}
MetadataResponse
IRGenFunction::emitGenericTypeMetadataAccessFunctionCall(
llvm::Function *accessFunction,
ArrayRef<llvm::Value *> args,
DynamicMetadataRequest request) {
MetadataResponse IRGenFunction::emitGenericTypeMetadataAccessFunctionCall(
llvm::Function *accessFunction, ArrayRef<llvm::Value *> args,
DynamicMetadataRequest request, bool hasPacks) {
SmallVector<llvm::Value *, 8> callArgs;
@@ -2495,7 +2493,7 @@ IRGenFunction::emitGenericTypeMetadataAccessFunctionCall(
accessFunction, callArgs);
call->setDoesNotThrow();
call->setCallingConv(IGM.SwiftCC);
call->setMemoryEffects(allocatedArgsBuffer
call->setMemoryEffects(hasPacks || allocatedArgsBuffer
? llvm::MemoryEffects::inaccessibleOrArgMemOnly()
: llvm::MemoryEffects::none());