Skip to content

Commit 76959b1

Browse files
committed
Remove CreateAsyncTaskGroupFuture and swift_task_create_group_future.
We've moved everything over to `CreateAsyncTask` now.
1 parent 8388a92 commit 76959b1

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
@@ -816,18 +816,6 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(EndAsyncLet, "endAsyncLet", "", Special)
816816
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTask,
817817
"createAsyncTask", "", Special)
818818

819-
/// createAsyncTaskGroupFuture(): (
820-
/// Int, // flags
821-
/// Builtin.RawPointer?, // group
822-
/// Builtin.RawPointer?, // options (TaskOptionRecord*)
823-
/// @escaping () async throws -> T // function
824-
/// ) -> Builtin.NativeObject
825-
///
826-
/// Create a new asynchronous task future, given flags, a parent task,
827-
/// task group and a function to execute.
828-
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTaskGroupFuture,
829-
"createAsyncTaskGroupFuture", "", Special)
830-
831819
/// globalStringTablePointer has type String -> Builtin.RawPointer.
832820
/// It returns an immortal, global string table pointer for strings constructed
833821
/// 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,
@@ -2764,9 +2748,6 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
27642748
case BuiltinValueKind::CreateAsyncTask:
27652749
return getCreateAsyncTask(Context, Id);
27662750

2767-
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
2768-
return getCreateAsyncTaskGroupFuture(Context, Id);
2769-
27702751
case BuiltinValueKind::ConvertTaskToJob:
27712752
return getConvertTaskToJob(Context, Id);
27722753

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
@@ -3860,7 +3860,6 @@ void irgen::emitTaskCancel(IRGenFunction &IGF, llvm::Value *task) {
38603860
llvm::Value *irgen::emitTaskCreate(
38613861
IRGenFunction &IGF,
38623862
llvm::Value *flags,
3863-
llvm::Value *taskGroup,
38643863
llvm::Value *taskOptions,
38653864
llvm::Value *futureResultType,
38663865
llvm::Value *taskFunction,
@@ -3869,26 +3868,13 @@ llvm::Value *irgen::emitTaskCreate(
38693868
llvm::CallInst *result;
38703869
taskOptions = IGF.Builder.CreateBitOrPointerCast(
38713870
taskOptions, IGF.IGM.SwiftTaskOptionRecordPtrTy);
3872-
if (taskGroup && futureResultType) {
3873-
taskGroup = IGF.Builder.CreateBitOrPointerCast(
3874-
taskGroup, IGF.IGM.SwiftTaskGroupPtrTy);
3875-
result = IGF.Builder.CreateCall(
3876-
IGF.IGM.getTaskCreateGroupFutureFn(),
3877-
{flags,
3878-
taskGroup,
3879-
taskOptions,
3880-
futureResultType,
3881-
taskFunction, localContextInfo});
3882-
} else if (futureResultType) {
3883-
result = IGF.Builder.CreateCall(
3884-
IGF.IGM.getTaskCreateFn(),
3885-
{flags,
3886-
taskOptions,
3887-
futureResultType,
3888-
taskFunction, localContextInfo});
3889-
} else {
3890-
llvm_unreachable("no future?!");
3891-
}
3871+
assert(futureResultType && "No future?!");
3872+
result = IGF.Builder.CreateCall(
3873+
IGF.IGM.getTaskCreateFn(),
3874+
{flags,
3875+
taskOptions,
3876+
futureResultType,
3877+
taskFunction, localContextInfo});
38923878
result->setDoesNotThrow();
38933879
result->setCallingConv(IGF.IGM.SwiftCC);
38943880

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
@@ -766,7 +766,6 @@ BUILTIN_OPERAND_OWNERSHIP(ForwardingConsume, COWBufferForReading)
766766
BUILTIN_OPERAND_OWNERSHIP(ForwardingConsume, UnsafeGuaranteed)
767767

768768
const int PARAMETER_INDEX_CREATE_ASYNC_TASK_FUTURE_FUNCTION = 3;
769-
const int PARAMETER_INDEX_CREATE_ASYNC_TASK_GROUP_FUTURE_FUNCTION = 4;
770769

771770
OperandOwnership
772771
OperandOwnershipBuiltinClassifier::visitCreateAsyncTask(BuiltinInst *bi,
@@ -782,20 +781,6 @@ OperandOwnershipBuiltinClassifier::visitCreateAsyncTask(BuiltinInst *bi,
782781
return OperandOwnership::InteriorPointer;
783782
}
784783

785-
OperandOwnership
786-
OperandOwnershipBuiltinClassifier::visitCreateAsyncTaskGroupFuture(BuiltinInst *bi,
787-
StringRef attr) {
788-
// The function operand is consumed by the new task.
789-
if (&op == &bi->getOperandRef(PARAMETER_INDEX_CREATE_ASYNC_TASK_GROUP_FUTURE_FUNCTION))
790-
return OperandOwnership::DestroyingConsume;
791-
792-
// FIXME: These are considered InteriorPointer because they may propagate a
793-
// pointer into a borrowed values. If they do not propagate an interior pointer,
794-
// then they should be InstantaneousUse instead and should not require a
795-
// guaranteed value.
796-
return OperandOwnership::InteriorPointer;
797-
}
798-
799784
OperandOwnership OperandOwnershipBuiltinClassifier::
800785
visitResumeNonThrowingContinuationReturning(BuiltinInst *bi, StringRef attr) {
801786
// 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
@@ -1855,7 +1855,6 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
18551855
case BuiltinValueKind::TSanInoutAccess:
18561856
case BuiltinValueKind::CancelAsyncTask:
18571857
case BuiltinValueKind::CreateAsyncTask:
1858-
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
18591858
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
18601859
case BuiltinValueKind::AutoDiffAllocateSubcontext:
18611860
case BuiltinValueKind::InitializeDefaultActor:

0 commit comments

Comments
 (0)