Skip to content

Commit 6ccd08b

Browse files
committed
Merge branch 'main' into rebranch.
Resolve conflicts introduced in #67944 as follows: ``` diff --git a/include/swift/Runtime/RuntimeFunctions.def b/include/swift/Runtime/RuntimeFunctions.def index 3c973b5884b..44cde70 100644 --- a/include/swift/Runtime/RuntimeFunctions.def +++ b/include/swift/Runtime/RuntimeFunctions.def @@ -2537,16 +2537,10 @@ FUNCTION(AutoDiffCreateLinearMapContextWithType, swift_autoDiffCreateLinearMapContextWithType, SwiftCC, DifferentiationAvailability, RETURNS(RefCountedPtrTy), -<<<<<<< HEAD - ARGS(SizeTy), + ARGS(TypeMetadataPtrTy), ATTRS(NoUnwind), EFFECT(AutoDiff), MEMEFFECTS(ArgMemOnly)) -======= - ARGS(TypeMetadataPtrTy), - ATTRS(NoUnwind, ArgMemOnly), - EFFECT(AutoDiff)) ->>>>>>> public-github/main // void *swift_autoDiffProjectTopLevelSubcontext(AutoDiffLinearMapContext *); FUNCTION(AutoDiffProjectTopLevelSubcontext, @@ -2563,16 +2557,10 @@ FUNCTION(AutoDiffAllocateSubcontextWithType, swift_autoDiffAllocateSubcontextWithType, SwiftCC, DifferentiationAvailability, RETURNS(Int8PtrTy), -<<<<<<< HEAD - ARGS(RefCountedPtrTy, SizeTy), + ARGS(RefCountedPtrTy, TypeMetadataPtrTy), ATTRS(NoUnwind), EFFECT(AutoDiff), MEMEFFECTS(ArgMemOnly)) -======= - ARGS(RefCountedPtrTy, TypeMetadataPtrTy), - ATTRS(NoUnwind, ArgMemOnly), - EFFECT(AutoDiff)) ->>>>>>> public-github/main ```
2 parents 86d56fd + c17f686 commit 6ccd08b

37 files changed

+2236
-627
lines changed

include/swift/ABI/Metadata.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,8 @@ struct TargetMetadata {
324324

325325
const uint8_t *getLayoutString() const {
326326
assert(hasLayoutString());
327-
if (isAnyClass()) {
328-
return asFullMetadata(
329-
reinterpret_cast<const TargetAnyClassMetadata<Runtime> *>(
330-
this))
331-
->layoutString;
332-
}
327+
// Classes should not have layout strings
328+
assert(!isAnyClass());
333329
return asFullMetadata(this)->layoutString;
334330
}
335331

include/swift/AST/Builtins.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,14 +985,14 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTaskInGroup,
985985
/// is a pure value and therefore we can consider it as readnone).
986986
BUILTIN_MISC_OPERATION_WITH_SILGEN(GlobalStringTablePointer, "globalStringTablePointer", "n", Special)
987987

988-
// autoDiffCreateLinearMapContext: (Builtin.Word) -> Builtin.NativeObject
989-
BUILTIN_MISC_OPERATION_WITH_SILGEN(AutoDiffCreateLinearMapContext, "autoDiffCreateLinearMapContext", "", Special)
988+
// autoDiffCreateLinearMapContextWithType: (T.Type) -> Builtin.NativeObject
989+
BUILTIN_MISC_OPERATION_WITH_SILGEN(AutoDiffCreateLinearMapContextWithType, "autoDiffCreateLinearMapContextWithType", "", Special)
990990

991991
// autoDiffProjectTopLevelSubcontext: (Builtin.NativeObject) -> Builtin.RawPointer
992992
BUILTIN_MISC_OPERATION_WITH_SILGEN(AutoDiffProjectTopLevelSubcontext, "autoDiffProjectTopLevelSubcontext", "n", Special)
993993

994-
// autoDiffAllocateSubcontext: (Builtin.NativeObject, Builtin.Word) -> Builtin.RawPointer
995-
BUILTIN_MISC_OPERATION_WITH_SILGEN(AutoDiffAllocateSubcontext, "autoDiffAllocateSubcontext", "", Special)
994+
// autoDiffAllocateSubcontextWithType: (Builtin.NativeObject, T.Type) -> Builtin.RawPointer
995+
BUILTIN_MISC_OPERATION_WITH_SILGEN(AutoDiffAllocateSubcontextWithType, "autoDiffAllocateSubcontextWithType", "", Special)
996996

997997
/// Build a Builtin.Executor value from an "ordinary" serial executor
998998
/// reference.

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,12 +2532,12 @@ FUNCTION(TaskGroupDestroy,
25322532
EFFECT(Concurrency),
25332533
UNKNOWN_MEMEFFECTS)
25342534

2535-
// AutoDiffLinearMapContext *swift_autoDiffCreateLinearMapContext(size_t);
2536-
FUNCTION(AutoDiffCreateLinearMapContext,
2537-
swift_autoDiffCreateLinearMapContext, SwiftCC,
2535+
// AutoDiffLinearMapContext *swift_autoDiffCreateLinearMapContextWithType(const Metadata *);
2536+
FUNCTION(AutoDiffCreateLinearMapContextWithType,
2537+
swift_autoDiffCreateLinearMapContextWithType, SwiftCC,
25382538
DifferentiationAvailability,
25392539
RETURNS(RefCountedPtrTy),
2540-
ARGS(SizeTy),
2540+
ARGS(TypeMetadataPtrTy),
25412541
ATTRS(NoUnwind),
25422542
EFFECT(AutoDiff),
25432543
MEMEFFECTS(ArgMemOnly))
@@ -2552,12 +2552,12 @@ FUNCTION(AutoDiffProjectTopLevelSubcontext,
25522552
EFFECT(AutoDiff),
25532553
MEMEFFECTS(ArgMemOnly))
25542554

2555-
// void *swift_autoDiffAllocateSubcontext(AutoDiffLinearMapContext *, size_t);
2556-
FUNCTION(AutoDiffAllocateSubcontext,
2557-
swift_autoDiffAllocateSubcontext, SwiftCC,
2555+
// void *swift_autoDiffAllocateSubcontextWithType(AutoDiffLinearMapContext *, const Metadata *);
2556+
FUNCTION(AutoDiffAllocateSubcontextWithType,
2557+
swift_autoDiffAllocateSubcontextWithType, SwiftCC,
25582558
DifferentiationAvailability,
25592559
RETURNS(Int8PtrTy),
2560-
ARGS(RefCountedPtrTy, SizeTy),
2560+
ARGS(RefCountedPtrTy, TypeMetadataPtrTy),
25612561
ATTRS(NoUnwind),
25622562
EFFECT(AutoDiff),
25632563
MEMEFFECTS(ArgMemOnly))

lib/AST/Builtins.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,8 @@ static ValueDecl *getBuildComplexEqualitySerialExecutorRef(ASTContext &ctx,
16091609
static ValueDecl *getAutoDiffCreateLinearMapContext(ASTContext &ctx,
16101610
Identifier id) {
16111611
return getBuiltinFunction(
1612-
id, {BuiltinIntegerType::getWordType(ctx)}, ctx.TheNativeObjectType);
1612+
ctx, id, _thin, _generics(_unrestricted),
1613+
_parameters(_metatype(_typeparam(0))), _nativeObject);
16131614
}
16141615

16151616
static ValueDecl *getAutoDiffProjectTopLevelSubcontext(ASTContext &ctx,
@@ -1621,8 +1622,8 @@ static ValueDecl *getAutoDiffProjectTopLevelSubcontext(ASTContext &ctx,
16211622
static ValueDecl *getAutoDiffAllocateSubcontext(ASTContext &ctx,
16221623
Identifier id) {
16231624
return getBuiltinFunction(
1624-
id, {ctx.TheNativeObjectType, BuiltinIntegerType::getWordType(ctx)},
1625-
ctx.TheRawPointerType);
1625+
ctx, id, _thin, _generics(_unrestricted),
1626+
_parameters(_nativeObject, _metatype(_typeparam(0))), _rawPointer);
16261627
}
16271628

16281629
static ValueDecl *getPoundAssert(ASTContext &Context, Identifier Id) {
@@ -2949,13 +2950,13 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
29492950
case BuiltinValueKind::HopToActor:
29502951
return getHopToActor(Context, Id);
29512952

2952-
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
2953+
case BuiltinValueKind::AutoDiffCreateLinearMapContextWithType:
29532954
return getAutoDiffCreateLinearMapContext(Context, Id);
29542955

29552956
case BuiltinValueKind::AutoDiffProjectTopLevelSubcontext:
29562957
return getAutoDiffProjectTopLevelSubcontext(Context, Id);
29572958

2958-
case BuiltinValueKind::AutoDiffAllocateSubcontext:
2959+
case BuiltinValueKind::AutoDiffAllocateSubcontextWithType:
29592960
return getAutoDiffAllocateSubcontext(Context, Id);
29602961
}
29612962

lib/IRGen/GenBuiltin.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,9 +1307,10 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
13071307
return;
13081308
}
13091309

1310-
if (Builtin.ID == BuiltinValueKind::AutoDiffCreateLinearMapContext) {
1311-
auto topLevelSubcontextSize = args.claimNext();
1312-
out.add(emitAutoDiffCreateLinearMapContext(IGF, topLevelSubcontextSize)
1310+
if (Builtin.ID == BuiltinValueKind::AutoDiffCreateLinearMapContextWithType) {
1311+
auto topLevelSubcontextMetaType = args.claimNext();
1312+
out.add(emitAutoDiffCreateLinearMapContextWithType(
1313+
IGF, topLevelSubcontextMetaType)
13131314
.getAddress());
13141315
return;
13151316
}
@@ -1322,12 +1323,13 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
13221323
return;
13231324
}
13241325

1325-
if (Builtin.ID == BuiltinValueKind::AutoDiffAllocateSubcontext) {
1326+
if (Builtin.ID == BuiltinValueKind::AutoDiffAllocateSubcontextWithType) {
13261327
Address allocatorAddr(args.claimNext(), IGF.IGM.RefCountedStructTy,
13271328
IGF.IGM.getPointerAlignment());
1328-
auto size = args.claimNext();
1329-
out.add(
1330-
emitAutoDiffAllocateSubcontext(IGF, allocatorAddr, size).getAddress());
1329+
auto subcontextMetatype = args.claimNext();
1330+
out.add(emitAutoDiffAllocateSubcontextWithType(IGF, allocatorAddr,
1331+
subcontextMetatype)
1332+
.getAddress());
13311333
return;
13321334
}
13331335

lib/IRGen/GenCall.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5483,11 +5483,13 @@ IRGenFunction::getFunctionPointerForResumeIntrinsic(llvm::Value *resume) {
54835483
return fnPtr;
54845484
}
54855485

5486-
Address irgen::emitAutoDiffCreateLinearMapContext(
5487-
IRGenFunction &IGF, llvm::Value *topLevelSubcontextSize) {
5486+
Address irgen::emitAutoDiffCreateLinearMapContextWithType(
5487+
IRGenFunction &IGF, llvm::Value *topLevelSubcontextMetatype) {
5488+
topLevelSubcontextMetatype = IGF.Builder.CreateBitCast(
5489+
topLevelSubcontextMetatype, IGF.IGM.TypeMetadataPtrTy);
54885490
auto *call = IGF.Builder.CreateCall(
5489-
IGF.IGM.getAutoDiffCreateLinearMapContextFunctionPointer(),
5490-
{topLevelSubcontextSize});
5491+
IGF.IGM.getAutoDiffCreateLinearMapContextWithTypeFunctionPointer(),
5492+
{topLevelSubcontextMetatype});
54915493
call->setDoesNotThrow();
54925494
call->setCallingConv(IGF.IGM.SwiftCC);
54935495
return Address(call, IGF.IGM.RefCountedStructTy,
@@ -5504,11 +5506,13 @@ Address irgen::emitAutoDiffProjectTopLevelSubcontext(
55045506
return Address(call, IGF.IGM.Int8Ty, IGF.IGM.getPointerAlignment());
55055507
}
55065508

5507-
Address irgen::emitAutoDiffAllocateSubcontext(
5508-
IRGenFunction &IGF, Address context, llvm::Value *size) {
5509+
Address irgen::emitAutoDiffAllocateSubcontextWithType(
5510+
IRGenFunction &IGF, Address context, llvm::Value *subcontextMetatype) {
5511+
subcontextMetatype =
5512+
IGF.Builder.CreateBitCast(subcontextMetatype, IGF.IGM.TypeMetadataPtrTy);
55095513
auto *call = IGF.Builder.CreateCall(
5510-
IGF.IGM.getAutoDiffAllocateSubcontextFunctionPointer(),
5511-
{context.getAddress(), size});
5514+
IGF.IGM.getAutoDiffAllocateSubcontextWithTypeFunctionPointer(),
5515+
{context.getAddress(), subcontextMetatype});
55125516
call->setDoesNotThrow();
55135517
call->setCallingConv(IGF.IGM.SwiftCC);
55145518
return Address(call, IGF.IGM.Int8Ty, IGF.IGM.getPointerAlignment());

lib/IRGen/GenCall.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,15 @@ namespace irgen {
261261
CanSILFunctionType fnType, Explosion &result,
262262
Explosion &error);
263263

264-
Address emitAutoDiffCreateLinearMapContext(
265-
IRGenFunction &IGF, llvm::Value *topLevelSubcontextSize);
264+
Address emitAutoDiffCreateLinearMapContextWithType(
265+
IRGenFunction &IGF, llvm::Value *topLevelSubcontextMetatype);
266+
266267
Address emitAutoDiffProjectTopLevelSubcontext(
267268
IRGenFunction &IGF, Address context);
268-
Address emitAutoDiffAllocateSubcontext(
269-
IRGenFunction &IGF, Address context, llvm::Value *size);
269+
270+
Address
271+
emitAutoDiffAllocateSubcontextWithType(IRGenFunction &IGF, Address context,
272+
llvm::Value *subcontextMetatype);
270273

271274
FunctionPointer getFunctionPointerForDispatchCall(IRGenModule &IGM,
272275
const FunctionPointer &fn);

lib/IRGen/GenMeta.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,8 +2586,7 @@ void irgen::emitLazyTypeContextDescriptor(IRGenModule &IGM,
25862586
IGM.Context.LangOpts.hasFeature(
25872587
Feature::LayoutStringValueWitnessesInstantiation) &&
25882588
IGM.getOptions().EnableLayoutStringValueWitnessesInstantiation) {
2589-
hasLayoutString |= requiresForeignTypeMetadata(type) ||
2590-
needsSingletonMetadataInitialization(IGM, type) ||
2589+
hasLayoutString |= needsSingletonMetadataInitialization(IGM, type) ||
25912590
(type->isGenericContext() && !isa<FixedTypeInfo>(ti));
25922591
}
25932592
}

lib/IRGen/GenStruct.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -919,10 +919,10 @@ namespace {
919919
field.getTypeInfo().buildTypeLayoutEntry(IGM, fieldTy, useStructLayouts));
920920
}
921921

922-
if (fields.size() == 1 && isFixedSize() &&
923-
getBestKnownAlignment() == *fields[0]->fixedAlignment(IGM)) {
924-
return fields[0];
925-
}
922+
// if (fields.size() == 1 && isFixedSize() &&
923+
// getBestKnownAlignment() == *fields[0]->fixedAlignment(IGM)) {
924+
// return fields[0];
925+
// }
926926

927927
return IGM.typeLayoutCache.getOrCreateAlignedGroupEntry(
928928
fields, T, getBestKnownAlignment().getValue(), *this);

lib/IRGen/TypeLayout.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class LayoutStringBuilder {
160160
RefCounting op;
161161
op.kind = RefCountingKind::SinglePayloadEnumFN;
162162
op.singlePayloadEnumFN.tagFn = tagFn;
163-
op.singlePayloadEnumSimple.extraTagByteCount = extraTagByteCount;
163+
op.singlePayloadEnumFN.extraTagByteCount = extraTagByteCount;
164164
op.singlePayloadEnumFN.payload = payload;
165165
refCountings.push_back(op);
166166
}
@@ -360,12 +360,19 @@ class LayoutStringBuilder {
360360
break;
361361
}
362362

363-
default: {
363+
case RefCountingKind::Existential: {
364364
uint64_t op = (static_cast<uint64_t>(refCounting.kind) << 56) | skip;
365365
B.addInt64(op);
366366
refCountBytes += sizeof(uint64_t);
367+
skip = refCounting.size - getFixedBufferSize(IGM).getValue();
368+
break;
369+
}
367370

368-
skip = refCounting.size;
371+
default: {
372+
uint64_t op = (static_cast<uint64_t>(refCounting.kind) << 56) | skip;
373+
B.addInt64(op);
374+
refCountBytes += sizeof(uint64_t);
375+
skip = refCounting.size - IGM.getPointerSize().getValue();
369376
break;
370377
}
371378
}
@@ -1734,7 +1741,7 @@ AlignedGroupEntry::layoutString(IRGenModule &IGM,
17341741

17351742
bool AlignedGroupEntry::refCountString(IRGenModule &IGM, LayoutStringBuilder &B,
17361743
GenericSignature genericSig) const {
1737-
if (!isFixedSize(IGM)) {
1744+
if (!isFixedSize(IGM) || ty.isMoveOnly()) {
17381745
return false;
17391746
}
17401747

lib/SIL/IR/OperandOwnership.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse, InitializeDistributedRemoteActor)
944944
BUILTIN_OPERAND_OWNERSHIP(InstantaneousUse,
945945
InitializeNonDefaultDistributedActor)
946946

947-
BUILTIN_OPERAND_OWNERSHIP(PointerEscape, AutoDiffAllocateSubcontext)
947+
BUILTIN_OPERAND_OWNERSHIP(PointerEscape, AutoDiffAllocateSubcontextWithType)
948948
BUILTIN_OPERAND_OWNERSHIP(PointerEscape, AutoDiffProjectTopLevelSubcontext)
949949

950950
// FIXME: ConvertTaskToJob is documented as taking NativePointer. It's operand's
@@ -956,8 +956,7 @@ BUILTIN_OPERAND_OWNERSHIP(BitwiseEscape, BuildComplexEqualitySerialExecutorRef)
956956
BUILTIN_OPERAND_OWNERSHIP(BitwiseEscape, BuildDefaultActorExecutorRef)
957957
BUILTIN_OPERAND_OWNERSHIP(BitwiseEscape, BuildMainActorExecutorRef)
958958

959-
BUILTIN_OPERAND_OWNERSHIP(TrivialUse, AutoDiffCreateLinearMapContext)
960-
959+
BUILTIN_OPERAND_OWNERSHIP(TrivialUse, AutoDiffCreateLinearMapContextWithType)
961960
#undef BUILTIN_OPERAND_OWNERSHIP
962961

963962
#define SHOULD_NEVER_VISIT_BUILTIN(ID) \

lib/SIL/IR/ValueOwnership.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ CONSTANT_OWNERSHIP_BUILTIN(None, InitializeDefaultActor)
572572
CONSTANT_OWNERSHIP_BUILTIN(None, DestroyDefaultActor)
573573
CONSTANT_OWNERSHIP_BUILTIN(None, InitializeDistributedRemoteActor)
574574
CONSTANT_OWNERSHIP_BUILTIN(None, InitializeNonDefaultDistributedActor)
575-
CONSTANT_OWNERSHIP_BUILTIN(Owned, AutoDiffCreateLinearMapContext)
575+
CONSTANT_OWNERSHIP_BUILTIN(Owned, AutoDiffCreateLinearMapContextWithType)
576576
CONSTANT_OWNERSHIP_BUILTIN(None, AutoDiffProjectTopLevelSubcontext)
577-
CONSTANT_OWNERSHIP_BUILTIN(None, AutoDiffAllocateSubcontext)
577+
CONSTANT_OWNERSHIP_BUILTIN(None, AutoDiffAllocateSubcontextWithType)
578578
CONSTANT_OWNERSHIP_BUILTIN(None, GetCurrentExecutor)
579579
CONSTANT_OWNERSHIP_BUILTIN(None, ResumeNonThrowingContinuationReturning)
580580
CONSTANT_OWNERSHIP_BUILTIN(None, ResumeThrowingContinuationReturning)

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,8 +2567,8 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
25672567
case BuiltinValueKind::CancelAsyncTask:
25682568
case BuiltinValueKind::CreateAsyncTask:
25692569
case BuiltinValueKind::CreateAsyncTaskInGroup:
2570-
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
2571-
case BuiltinValueKind::AutoDiffAllocateSubcontext:
2570+
case BuiltinValueKind::AutoDiffCreateLinearMapContextWithType:
2571+
case BuiltinValueKind::AutoDiffAllocateSubcontextWithType:
25722572
case BuiltinValueKind::InitializeDefaultActor:
25732573
case BuiltinValueKind::InitializeDistributedRemoteActor:
25742574
case BuiltinValueKind::InitializeNonDefaultDistributedActor:

lib/SILGen/SILGenBuiltin.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,16 +1708,15 @@ static ManagedValue emitBuiltinHopToActor(SILGenFunction &SGF, SILLocation loc,
17081708
return ManagedValue::forObjectRValueWithoutOwnership(SGF.emitEmptyTuple(loc));
17091709
}
17101710

1711-
static ManagedValue emitBuiltinAutoDiffCreateLinearMapContext(
1711+
static ManagedValue emitBuiltinAutoDiffCreateLinearMapContextWithType(
17121712
SILGenFunction &SGF, SILLocation loc, SubstitutionMap subs,
17131713
ArrayRef<ManagedValue> args, SGFContext C) {
17141714
ASTContext &ctx = SGF.getASTContext();
17151715
auto *builtinApply = SGF.B.createBuiltin(
17161716
loc,
1717-
ctx.getIdentifier(
1718-
getBuiltinName(BuiltinValueKind::AutoDiffCreateLinearMapContext)),
1719-
SILType::getNativeObjectType(ctx),
1720-
subs,
1717+
ctx.getIdentifier(getBuiltinName(
1718+
BuiltinValueKind::AutoDiffCreateLinearMapContextWithType)),
1719+
SILType::getNativeObjectType(ctx), subs,
17211720
/*args*/ {args[0].getValue()});
17221721
return SGF.emitManagedRValueWithCleanup(builtinApply);
17231722
}
@@ -1736,16 +1735,15 @@ static ManagedValue emitBuiltinAutoDiffProjectTopLevelSubcontext(
17361735
return ManagedValue::forObjectRValueWithoutOwnership(builtinApply);
17371736
}
17381737

1739-
static ManagedValue emitBuiltinAutoDiffAllocateSubcontext(
1738+
static ManagedValue emitBuiltinAutoDiffAllocateSubcontextWithType(
17401739
SILGenFunction &SGF, SILLocation loc, SubstitutionMap subs,
17411740
ArrayRef<ManagedValue> args, SGFContext C) {
17421741
ASTContext &ctx = SGF.getASTContext();
17431742
auto *builtinApply = SGF.B.createBuiltin(
17441743
loc,
17451744
ctx.getIdentifier(
1746-
getBuiltinName(BuiltinValueKind::AutoDiffAllocateSubcontext)),
1747-
SILType::getRawPointerType(ctx),
1748-
subs,
1745+
getBuiltinName(BuiltinValueKind::AutoDiffAllocateSubcontextWithType)),
1746+
SILType::getRawPointerType(ctx), subs,
17491747
/*args*/ {args[0].borrow(SGF, loc).getValue(), args[1].getValue()});
17501748
return ManagedValue::forObjectRValueWithoutOwnership(builtinApply);
17511749
}

0 commit comments

Comments
 (0)