Skip to content

Commit ec2d786

Browse files
Merge pull request #36490 from aschwaighofer/remove_unused_resume_parent_executor
Remove unused resume parent executor
2 parents bd70bee + 1720274 commit ec2d786

File tree

5 files changed

+2
-29
lines changed

5 files changed

+2
-29
lines changed

include/swift/ABI/Task.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,6 @@ class alignas(MaximumAlignment) AsyncContext {
483483
TaskContinuationFunction * __ptrauth_swift_async_context_resume
484484
ResumeParent;
485485

486-
/// The executor that the parent needs to be resumed on.
487-
/// FIXME: remove this
488-
ExecutorRef ResumeParentExecutor;
489-
490486
/// Flags describing this context.
491487
///
492488
/// Note that this field is only 32 bits; any alignment padding
@@ -499,7 +495,6 @@ class alignas(MaximumAlignment) AsyncContext {
499495
TaskContinuationFunction *resumeParent,
500496
AsyncContext *parent)
501497
: Parent(parent), ResumeParent(resumeParent),
502-
ResumeParentExecutor(ExecutorRef::generic()),
503498
Flags(flags) {}
504499

505500
AsyncContext(const AsyncContext &) = delete;

lib/IRGen/GenCall.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,6 @@ irgen::getAsyncContextLayout(IRGenModule &IGM, CanSILFunctionType originalType,
114114
valTypes.push_back(ty);
115115
typeInfos.push_back(&ti);
116116
};
117-
auto addExecutor = [&]() {
118-
auto ty = SILType();
119-
auto &ti = IGM.getSwiftExecutorPtrTypeInfo();
120-
valTypes.push_back(ty);
121-
typeInfos.push_back(&ti);
122-
};
123-
124117
// AsyncContext * __ptrauth_swift_async_context_parent Parent;
125118
{
126119
auto ty = SILType();
@@ -133,9 +126,6 @@ irgen::getAsyncContextLayout(IRGenModule &IGM, CanSILFunctionType originalType,
133126
// ResumeParent;
134127
addTaskContinuationFunction();
135128

136-
// ExecutorRef ResumeParentExecutor;
137-
addExecutor();
138-
139129
// AsyncContextFlags Flags;
140130
{
141131
auto ty = SILType::getPrimitiveObjectType(

lib/IRGen/GenCall.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,11 @@ namespace irgen {
8383
enum class FixedIndex : unsigned {
8484
Parent = 0,
8585
ResumeParent = 1,
86-
ResumeParentExecutor = 2,
87-
Flags = 3,
86+
Flags = 2,
8887
};
8988
enum class FixedCount : unsigned {
9089
Parent = 1,
9190
ResumeParent = 1,
92-
ResumeParentExecutor = 1,
9391
};
9492
CanSILFunctionType originalType;
9593
CanSILFunctionType substitutedType;
@@ -99,22 +97,13 @@ namespace irgen {
9997
unsigned getResumeParentIndex() {
10098
return (unsigned)FixedIndex::ResumeParent;
10199
}
102-
unsigned getResumeParentExecutorIndex() {
103-
return (unsigned)FixedIndex::ResumeParentExecutor;
104-
}
105100
unsigned getFlagsIndex() { return (unsigned)FixedIndex::Flags; }
106-
unsigned getErrorIndex() {
107-
return getFlagsIndex() + 1;
108-
}
109101

110102
public:
111103
ElementLayout getParentLayout() { return getElement(getParentIndex()); }
112104
ElementLayout getResumeParentLayout() {
113105
return getElement(getResumeParentIndex());
114106
}
115-
ElementLayout getResumeParentExecutorLayout() {
116-
return getElement(getResumeParentExecutorIndex());
117-
}
118107
ElementLayout getFlagsLayout() { return getElement(getFlagsIndex()); }
119108

120109
AsyncContextLayout(

stdlib/public/Concurrency/Task.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ static AsyncTaskAndContext swift_task_create_group_future_impl(
427427
initialContext->Parent = nullptr;
428428
initialContext->ResumeParent = reinterpret_cast<TaskContinuationFunction *>(
429429
closureContext ? &completeTaskWithClosure : &completeTask);
430-
initialContext->ResumeParentExecutor = ExecutorRef::generic();
431430
initialContext->Flags = AsyncContextKind::Ordinary;
432431
initialContext->Flags.setShouldNotDeallocateInCallee(true);
433432

test/IRGen/async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SomeClass {}
1717
public func task_future_wait(_ task: __owned SomeClass) async throws -> Int
1818

1919
// CHECK: define{{.*}} swift{{(tail)?}}cc void @"$s5async8testThisyyAA9SomeClassCnYF"(%swift.context* swiftasync %0{{.*}}
20-
// CHECK-64: call swiftcc i8* @swift_task_alloc(i64 56)
20+
// CHECK-64: call swiftcc i8* @swift_task_alloc(i64 48)
2121
// CHECK: {{(must)?}}tail call swift{{(tail)?}}cc void @swift_task_future_wait(
2222
public func testThis(_ task: __owned SomeClass) async {
2323
do {

0 commit comments

Comments
 (0)