Skip to content

Commit cd75691

Browse files
committed
Remove CreateAsyncTaskGroupFuture and swift_task_create_group_future.
We've moved everything over to `CreateAsyncTask` now.
1 parent ee7c53d commit cd75691

File tree

14 files changed

+8
-179
lines changed

14 files changed

+8
-179
lines changed

include/swift/AST/Builtins.def

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -805,18 +805,6 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(EndAsyncLet, "endAsyncLet", "", Special)
805805
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTask,
806806
"createAsyncTask", "", Special)
807807

808-
/// createAsyncTaskGroupFuture(): (
809-
/// Int, // flags
810-
/// Builtin.RawPointer?, // group
811-
/// Builtin.RawPointer?, // options (TaskOptionRecord*)
812-
/// @escaping () async throws -> T // function
813-
/// ) -> Builtin.NativeObject
814-
///
815-
/// Create a new asynchronous task future, given flags, a parent task,
816-
/// task group and a function to execute.
817-
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTaskGroupFuture,
818-
"createAsyncTaskGroupFuture", "", Special)
819-
820808
/// globalStringTablePointer has type String -> Builtin.RawPointer.
821809
/// It returns an immortal, global string table pointer for strings constructed
822810
/// from string literals. We consider it effects as readnone meaning that it

include/swift/Runtime/Concurrency.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ AsyncTaskAndContext swift_task_create_common(
6767
FutureAsyncSignature::FunctionType *function, void *closureContext,
6868
size_t initialContextSize);
6969

70-
/// Create a task object with a future which will run the given
71-
/// closure, and offer its result to the task group
72-
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
73-
AsyncTaskAndContext swift_task_create_group_future(
74-
size_t flags,
75-
TaskGroup *group,
76-
TaskOptionRecord *options,
77-
const Metadata *futureResultType,
78-
void *closureEntryPoint, HeapObject * /* +1 */ closureContext);
79-
8070
/// Allocate memory in a task.
8171
///
8272
/// This must be called synchronously with the task.

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,24 +1547,6 @@ FUNCTION(TaskCancel,
15471547
ARGS(SwiftTaskPtrTy),
15481548
ATTRS(NoUnwind, ArgMemOnly))
15491549

1550-
// AsyncTaskAndContext swift_task_create_group_future(
1551-
// size_t flags,
1552-
// TaskGroup *group,
1553-
// TaskOptionRecord *options
1554-
// const Metadata *futureResultType,
1555-
// void *closureEntry, HeapObject *closureContext);
1556-
FUNCTION(TaskCreateGroupFuture,
1557-
swift_task_create_group_future, SwiftCC,
1558-
ConcurrencyAvailability,
1559-
RETURNS(AsyncTaskAndContextTy),
1560-
ARGS(SizeTy,
1561-
SwiftTaskGroupPtrTy,
1562-
SwiftTaskOptionRecordPtrTy,
1563-
TypeMetadataPtrTy,
1564-
Int8PtrTy,
1565-
RefCountedPtrTy),
1566-
ATTRS(NoUnwind, ArgMemOnly))
1567-
15681550
// AsyncTaskAndContext swift_task_create(
15691551
// size_t taskCreateFlags,
15701552
// TaskOptionRecord *options,

lib/AST/Builtins.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,22 +1437,6 @@ static ValueDecl *getCreateAsyncTask(ASTContext &ctx, Identifier id) {
14371437
return builder.build(id);
14381438
}
14391439

1440-
static ValueDecl *getCreateAsyncTaskGroupFuture(ASTContext &ctx, Identifier id) {
1441-
BuiltinFunctionBuilder builder(ctx);
1442-
auto genericParam = makeGenericParam().build(builder); // <T>
1443-
builder.addParameter(makeConcrete(ctx.getIntType())); // 0 flags
1444-
builder.addParameter(
1445-
makeConcrete(OptionalType::get(ctx.TheRawPointerType))); // 1 group
1446-
builder.addParameter(
1447-
makeConcrete(OptionalType::get(ctx.TheRawPointerType))); // 2 options
1448-
auto extInfo = ASTExtInfoBuilder().withAsync().withThrows().build();
1449-
builder.addParameter(
1450-
makeConcrete(FunctionType::get({ }, genericParam, extInfo))); // 3 operation
1451-
builder.setResult(makeConcrete(getAsyncTaskAndContextType(ctx)));
1452-
1453-
return builder.build(id);
1454-
}
1455-
14561440
static ValueDecl *getConvertTaskToJob(ASTContext &ctx, Identifier id) {
14571441
return getBuiltinFunction(ctx, id,
14581442
_thin,
@@ -2746,9 +2730,6 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
27462730
case BuiltinValueKind::CreateAsyncTask:
27472731
return getCreateAsyncTask(Context, Id);
27482732

2749-
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
2750-
return getCreateAsyncTaskGroupFuture(Context, Id);
2751-
27522733
case BuiltinValueKind::ConvertTaskToJob:
27532734
return getConvertTaskToJob(Context, Id);
27542735

lib/IRGen/GenBuiltin.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,8 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
270270
return;
271271
}
272272

273-
if (Builtin.ID == BuiltinValueKind::CreateAsyncTask ||
274-
Builtin.ID == BuiltinValueKind::CreateAsyncTaskGroupFuture) {
275-
273+
if (Builtin.ID == BuiltinValueKind::CreateAsyncTask) {
276274
auto flags = args.claimNext();
277-
auto taskGroup =
278-
(Builtin.ID == BuiltinValueKind::CreateAsyncTaskGroupFuture)
279-
? args.claimNext()
280-
: nullptr;
281275
auto taskOptions = args.claimNext();
282276
auto futureResultType = args.claimNext();
283277
auto taskFunction = args.claimNext();
@@ -286,7 +280,6 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
286280
auto newTaskAndContext = emitTaskCreate(
287281
IGF,
288282
flags,
289-
taskGroup,
290283
taskOptions,
291284
futureResultType,
292285
taskFunction, taskContext,

lib/IRGen/GenCall.cpp

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,7 +3859,6 @@ void irgen::emitTaskCancel(IRGenFunction &IGF, llvm::Value *task) {
38593859
llvm::Value *irgen::emitTaskCreate(
38603860
IRGenFunction &IGF,
38613861
llvm::Value *flags,
3862-
llvm::Value *taskGroup,
38633862
llvm::Value *taskOptions,
38643863
llvm::Value *futureResultType,
38653864
llvm::Value *taskFunction,
@@ -3868,26 +3867,13 @@ llvm::Value *irgen::emitTaskCreate(
38683867
llvm::CallInst *result;
38693868
taskOptions = IGF.Builder.CreateBitOrPointerCast(
38703869
taskOptions, IGF.IGM.SwiftTaskOptionRecordPtrTy);
3871-
if (taskGroup && futureResultType) {
3872-
taskGroup = IGF.Builder.CreateBitOrPointerCast(
3873-
taskGroup, IGF.IGM.SwiftTaskGroupPtrTy);
3874-
result = IGF.Builder.CreateCall(
3875-
IGF.IGM.getTaskCreateGroupFutureFn(),
3876-
{flags,
3877-
taskGroup,
3878-
taskOptions,
3879-
futureResultType,
3880-
taskFunction, localContextInfo});
3881-
} else if (futureResultType) {
3882-
result = IGF.Builder.CreateCall(
3883-
IGF.IGM.getTaskCreateFn(),
3884-
{flags,
3885-
taskOptions,
3886-
futureResultType,
3887-
taskFunction, localContextInfo});
3888-
} else {
3889-
llvm_unreachable("no future?!");
3890-
}
3870+
assert(futureResultType && "No future?!");
3871+
result = IGF.Builder.CreateCall(
3872+
IGF.IGM.getTaskCreateFn(),
3873+
{flags,
3874+
taskOptions,
3875+
futureResultType,
3876+
taskFunction, localContextInfo});
38913877
result->setDoesNotThrow();
38923878
result->setCallingConv(IGF.IGM.SwiftCC);
38933879

lib/IRGen/GenCall.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ namespace irgen {
229229
llvm::Value *emitTaskCreate(
230230
IRGenFunction &IGF,
231231
llvm::Value *flags,
232-
llvm::Value *taskGroup,
233232
llvm::Value *taskOptions,
234233
llvm::Value *futureResultType,
235234
llvm::Value *taskFunction,

lib/SIL/IR/OperandOwnership.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,6 @@ BUILTIN_OPERAND_OWNERSHIP(ForwardingConsume, COWBufferForReading)
754754
BUILTIN_OPERAND_OWNERSHIP(ForwardingConsume, UnsafeGuaranteed)
755755

756756
const int PARAMETER_INDEX_CREATE_ASYNC_TASK_FUTURE_FUNCTION = 3;
757-
const int PARAMETER_INDEX_CREATE_ASYNC_TASK_GROUP_FUTURE_FUNCTION = 4;
758757

759758
OperandOwnership
760759
OperandOwnershipBuiltinClassifier::visitCreateAsyncTask(BuiltinInst *bi,
@@ -770,20 +769,6 @@ OperandOwnershipBuiltinClassifier::visitCreateAsyncTask(BuiltinInst *bi,
770769
return OperandOwnership::InteriorPointer;
771770
}
772771

773-
OperandOwnership
774-
OperandOwnershipBuiltinClassifier::visitCreateAsyncTaskGroupFuture(BuiltinInst *bi,
775-
StringRef attr) {
776-
// The function operand is consumed by the new task.
777-
if (&op == &bi->getOperandRef(PARAMETER_INDEX_CREATE_ASYNC_TASK_GROUP_FUTURE_FUNCTION))
778-
return OperandOwnership::DestroyingConsume;
779-
780-
// FIXME: These are considered InteriorPointer because they may propagate a
781-
// pointer into a borrowed values. If they do not propagate an interior pointer,
782-
// then they should be InstantaneousUse instead and should not require a
783-
// guaranteed value.
784-
return OperandOwnership::InteriorPointer;
785-
}
786-
787772
OperandOwnership OperandOwnershipBuiltinClassifier::
788773
visitResumeNonThrowingContinuationReturning(BuiltinInst *bi, StringRef attr) {
789774
// The value operand is consumed.

lib/SIL/IR/ValueOwnership.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ CONSTANT_OWNERSHIP_BUILTIN(None, GlobalStringTablePointer)
533533
CONSTANT_OWNERSHIP_BUILTIN(None, GetCurrentAsyncTask)
534534
CONSTANT_OWNERSHIP_BUILTIN(None, CancelAsyncTask)
535535
CONSTANT_OWNERSHIP_BUILTIN(Owned, CreateAsyncTask)
536-
CONSTANT_OWNERSHIP_BUILTIN(Owned, CreateAsyncTaskGroupFuture)
537536
CONSTANT_OWNERSHIP_BUILTIN(None, ConvertTaskToJob)
538537
CONSTANT_OWNERSHIP_BUILTIN(None, InitializeDefaultActor)
539538
CONSTANT_OWNERSHIP_BUILTIN(None, DestroyDefaultActor)

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,6 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
18531853
case BuiltinValueKind::TSanInoutAccess:
18541854
case BuiltinValueKind::CancelAsyncTask:
18551855
case BuiltinValueKind::CreateAsyncTask:
1856-
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
18571856
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
18581857
case BuiltinValueKind::AutoDiffAllocateSubcontext:
18591858
case BuiltinValueKind::InitializeDefaultActor:

0 commit comments

Comments
 (0)