profile
viewpoint

nate-chandler/swift 0

The Swift Programming Language

nate-chandler/swift-evolution 0

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

nate-chandler/swift-source-compat-suite 0

The infrastructure and project index comprising the Swift source compatibility suite.

push eventapple/swift

Nate Chandler

commit sha 989ea5bf5e547f7d11c0d3cb71bb254de31009e1

[IRGen] Track repeated requirements for async functions in NecessaryBindings. Previously, NecessaryBindings used a SetVector to store the GenericRequirements that it accumulates. That was a problem for the layout of async contexts where it is possible for the same generic argument to be repeated. Meanwhile, that is correct for partial application forwarders where there is a single thunk for every partial apply and consequently the bindings can be packed in without duplication. Here, a SetVector is used only when the NecessaryBindings are for partial apply forwarders. When the NecessaryBindings are instead for async functions, a SmallVector is used.

view details

Nate Chandler

commit sha 6829b6656de18cdf53de4a71dcdfc0d35e280472

[NFC] Replaced include with forward declaration.

view details

Nate Chandler

commit sha b8a5b62f720bd351a55cfa293de5a9a6d33a6e5a

[NFC] Cached the layout in AsyncCallEmission.

view details

Nate Chandler

commit sha 128c7bc03a55c682210844d42ffc5fcec48d2335

[NFC] Whitespace.

view details

Nate Chandler

commit sha e066588460d6986ed0c435dbf6265beb138b77db

[IRGen] Temporarily treat @async @convention(c) as not async.

view details

Nate Chandler

commit sha 9135eafd36390677a4c428bafa9229064f6bced8

[Test] Temporarily mark async execution tests' main @async.

view details

Nate Chandler

commit sha c2469fcf90fa733fad1d7a3c4fcef6dc18ead113

[Test] Made async exec tests obey async rule. Previously the execution tests for the async calling convention ignored the rule that callers of async functions must themselves be async. Failing to obey that rule prevented landing of the SIL verification change that enforces that rule. Here, the tests are modified to satisfy that rule so that the SIL verification change can be landed.

view details

Nate Chandler

commit sha a963d0a66b64be336d02af56c28490987252b9c0

[Async CC] Added TODO for codesize improvement.

view details

nate-chandler

commit sha d1bfe027c0f86c5c8cbb422b0f58fdbe87396d01

Merge pull request #34402 from nate-chandler/concurrency/irgen/tests-all-async [Async CC] Test: Mark functions that call async functions async.

view details

push time in an hour

delete branch nate-chandler/swift

delete branch : concurrency/irgen/tests-all-async

delete time in an hour

PR merged apple/swift

Reviewers
[Async CC] Test: Mark functions that call async functions async.

To unblock the SIL verification that async functions are called only from async functions, update the tests to meet this invariant. To enable this, in particular, @main had to be marked @async until Task.runDetached is available. To allow that, a couple of small workaround were commited in their own commit. Reverting that commit when possible is tracked by rdar://problem/70597390.

This process revealed an issue with AsyncContextLayout's usage of NecessaryBindings. Specifically, if an async function happens to use the same generic parameter twice, space was only made in the layout for one usage. That can't work for async callees which actually have two distinct generic parameters since they will need to bind the two distinct generic parameters separately since in general they will not be the same type even though at a particular call site they happened to be the same. To address this, make NecessaryBindings use a vector rather than a set to collection generic requirements.

+197 -155

3 comments

37 changed files

nate-chandler

pr closed time in an hour

pull request commentapple/llvm-project

[Coroutines] Reuse storage for local variables with non-overlapping lifetimes

@swift-ci please test

nate-chandler

comment created time in 3 days

pull request commentapple/swift

[Async CC] Test: Mark functions that call async functions async.

@swift-ci please test windows platform

nate-chandler

comment created time in 3 days

pull request commentapple/swift

[Async CC] Test: Mark functions that call async functions async.

@swift-ci please test

nate-chandler

comment created time in 3 days

push eventnate-chandler/swift

Nate Chandler

commit sha 989ea5bf5e547f7d11c0d3cb71bb254de31009e1

[IRGen] Track repeated requirements for async functions in NecessaryBindings. Previously, NecessaryBindings used a SetVector to store the GenericRequirements that it accumulates. That was a problem for the layout of async contexts where it is possible for the same generic argument to be repeated. Meanwhile, that is correct for partial application forwarders where there is a single thunk for every partial apply and consequently the bindings can be packed in without duplication. Here, a SetVector is used only when the NecessaryBindings are for partial apply forwarders. When the NecessaryBindings are instead for async functions, a SmallVector is used.

view details

Nate Chandler

commit sha 6829b6656de18cdf53de4a71dcdfc0d35e280472

[NFC] Replaced include with forward declaration.

view details

Nate Chandler

commit sha b8a5b62f720bd351a55cfa293de5a9a6d33a6e5a

[NFC] Cached the layout in AsyncCallEmission.

view details

Nate Chandler

commit sha 128c7bc03a55c682210844d42ffc5fcec48d2335

[NFC] Whitespace.

view details

Nate Chandler

commit sha e066588460d6986ed0c435dbf6265beb138b77db

[IRGen] Temporarily treat @async @convention(c) as not async.

view details

Nate Chandler

commit sha 9135eafd36390677a4c428bafa9229064f6bced8

[Test] Temporarily mark async execution tests' main @async.

view details

Nate Chandler

commit sha c2469fcf90fa733fad1d7a3c4fcef6dc18ead113

[Test] Made async exec tests obey async rule. Previously the execution tests for the async calling convention ignored the rule that callers of async functions must themselves be async. Failing to obey that rule prevented landing of the SIL verification change that enforces that rule. Here, the tests are modified to satisfy that rule so that the SIL verification change can be landed.

view details

Nate Chandler

commit sha a963d0a66b64be336d02af56c28490987252b9c0

[Async CC] Added TODO for codesize improvement.

view details

push time in 3 days

push eventnate-chandler/swift

Nate Chandler

commit sha 22dbea96a8f2d79293afe8f5b075d17e654e070a

[Test] Made async exec tests obey async rule. Previously the execution tests for the async calling convention ignored the rule that callers of async functions must themselves be async. Failing to obey that rule prevented landing of the SIL verification change that enforces that rule. Here, the tests are modified to satisfy that rule so that the SIL verification change can be landed.

view details

push time in 3 days

push eventnate-chandler/swift

Nate Chandler

commit sha 0fc6c9cb151e7352cdf112f2ee40d19239e5fe60

[IRGen] Track repeated requirements in NcessaryBindings. Previously, NecessaryBindings used a SetVector to store the GenericRequirements that it accumulates. That was a problem for the layout of async contexts where it is possible for the same generic argument to be repeated. Here, that SetVector is replaced with a SmallVector.

view details

Nate Chandler

commit sha 6f62c91114734c8621b907e2c812737973533834

[NFC] Replaced include with forward declaration.

view details

Nate Chandler

commit sha b8828956faab03bc75e0d5dda31832c8ae211e68

[NFC] Cached the layout in AsyncCallEmission.

view details

Nate Chandler

commit sha 60cbceabbcec87f74e3a0e6f504482a675fc9ce4

[NFC] Whitespace.

view details

Nate Chandler

commit sha 9c329cf6052a305d4a397d45426f9e4d45044284

[IRGen] Temporarily treat @async @convention(c) as not async.

view details

Nate Chandler

commit sha 8e4062841fc560973195ee9b08b8300e94b4eab1

[Test] Temporarily mark async execution tests' main @async.

view details

Nate Chandler

commit sha c532dd0e7b97e0f89ca14c977946376f27825a12

[Test] Made all async IRGen test functions @async.

view details

push time in 3 days

pull request commentapple/swift

[Async CC] Test: Mark functions that call async functions async.

@swift-ci please test

nate-chandler

comment created time in 4 days

PR opened apple/swift

[Async CC] Test: Mark functions that call async functions async.

To unblock the SIL verification that async functions are called only from async functions, update the tests to meet this invariant. To enable this, in particular, @main had to be marked @async until Task.runDetached is available. To allow that, a couple of small workaround were commited in their own commit. Reverting that commit when possible is tracked by rdar://problem/70597390.

This process revealed an issue with AsyncContextLayout's usage of NecessaryBindings. Specifically, if an async function happens to use the same generic parameter twice, space was only made in the layout for one usage. That can't work for async callees which actually have two distinct generic parameters since they will need to bind the two distinct generic parameters separately since in general they will not be the same type even though at a particular call site they happened to be the same. To address this, make NecessaryBindings use a vector rather than a set to collection generic requirements.

+112 -102

0 comment

36 changed files

pr created time in 4 days

create barnchnate-chandler/swift

branch : concurrency/irgen/tests-all-async

created branch time in 4 days

delete branch nate-chandler/swift

delete branch : concurrency/irgen/partial-apply

delete time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test

nate-chandler

comment created time in 4 days

push eventnate-chandler/swift

Nate Chandler

commit sha 506473dfba40cde3bfb5480b6d44f2d9c26f2cab

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test

nate-chandler

comment created time in 4 days

push eventnate-chandler/swift

Nate Chandler

commit sha 492a938bb0704ad69efad5a0819b77bec6a543b9

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test and merge

nate-chandler

comment created time in 4 days

push eventnate-chandler/swift

Nate Chandler

commit sha 8d10f0996a0a94d58cf60ad5393fec5d9146b00d

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 4 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please asan test

nate-chandler

comment created time in 5 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 5 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test

nate-chandler

comment created time in 5 days

push eventnate-chandler/swift

Nate Chandler

commit sha 3e66f6157c7580409bde7d84bf88a74b6f01a0a6

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 5 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please ASAN test

nate-chandler

comment created time in 5 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test windows platform

nate-chandler

comment created time in 5 days

pull request commentapple/swift

[Async CC] Support for partial application.

@swift-ci please test

nate-chandler

comment created time in 5 days

push eventnate-chandler/swift

Nate Chandler

commit sha cf0a461b955217a5e9ab0ca83d482acb026861de

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 5 days

push eventnate-chandler/swift

Nate Chandler

commit sha 97202faee50f20d1e86be9205b87ca8b801cd342

[Async CC] Put direct returns after indirect returns. For callers who do not know the actual type of the called function, e.g. when the called function is the result of a partial apply, the offset to the direct returns would otherwise not be known.

view details

Nate Chandler

commit sha a9aee1b9ddbba56a27de3a604cecefb17ed042a5

[Async CC] Put bindings after formal arguments. Bindings will always be supplied by the first partial apply, so they will only be added to the async context when its full layout is known. If they are earlier in the layout, subsequent partial applies will put their arguments into the wrong position because they will not be privy to the space requirements of the bindings.

view details

Nate Chandler

commit sha 409f3d253b4f09de15722b4f08d65e7b60f9b461

[NFC] Removed Explosion::peek. The convenience was added to aid with the async calling convention but it has proven to be unnecessary. Here, it is removed.

view details

Nate Chandler

commit sha 0356c9f4c009daea16595a39690be335c70f2367

[NFC] Simplify saving of self to async context.

view details

Nate Chandler

commit sha 63b5ba457e5a36e890fd4846fc9ec0f2b638259c

[NFC] Used consistent style for casting.

view details

Nate Chandler

commit sha 03f4e40f20c512fad34cae93a89144090bda1ee5

[Async CC] Move self after formal arguments. Partial applies of methods supply only self. When applies of the resulting thick function are performed, that self was one of the arguments is not known. As a result, self must appear after the fields that might be supplied at the apply site, which is to say all the arguments.

view details

Nate Chandler

commit sha 2f440fbe147c81931dd044baa8612497ab41da64

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 5 days

push eventnate-chandler/swift

Nate Chandler

commit sha 19818c35a035c26b481b5dee73fe8ff84999736f

[Async CC] Supported partial application. The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time. The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.) To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>). To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly. To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

view details

push time in 5 days

pull request commentapple/swift

[Async CC] Supported partial application.

@swift-ci please test

nate-chandler

comment created time in 6 days

PR opened apple/swift

[Async CC] Supported partial application.

The majority of support comes in the form of emitting partial application forwarders for partial applications of async functions. Such a partial application forwarder must take an async context which has been partially populated at the apply site. It is responsible for populating it "the rest of the way". To do so, like sync partial application forwarders, it takes a second argument, its context, from which it pulls the additional arguments which were capture at partial_apply time.

The size of the async context that is passed to the forwarder, however, can't be known at the apply site by simply looking at the signature of the function to be applied (not even by looking at the size associated with the function in the special async function pointer constant which will soon be emitted). The reason is that there are an unknown (at the apply site) number of additional arguments which will be filled by the partial apply forwarder (and in the case of repeated partial applications, further filled in incrementally at each level). To enable this, there will always be a heap object for thick async functions. These heap objects will always store the size of the async context to be allocated as their first element. (Note that it may be possible to apply the same optimization that was applied for thick sync functions where a single refcounted object could be used as the context; doing so, however, must be made to interact properly with the async context size stored in the heap object.)

To continue to allow promoting thin async functions to thick async functions without incurring a thunk, at the apply site, a null-check will be performed on the context pointer. If it is null, then the async context size will be determined based on the signature. (When async function pointers become pointers to a constant with a size i32 and a relative address to the underlying function, the size will be read from that constant.) When it is not-null, the size will be pulled from the first field of the context (which will in that case be cast to <{%swift.refcounted, i32}>).

To facilitate sharing code and preserving the original structure of emitPartialApplicationForwarder (which weighed in at roughly 700 lines prior to this change), a new small class hierarchy, descending from PartialApplicationForwarderEmission has been added, with subclasses for the sync and async case. The shuffling of arguments into and out of the final explosion that was being performed in the synchronous case has been preserved there, though the arguments are added and removed through a number of methods on the superclass with more descriptive names. That was necessary to enable the async class to handle these different flavors of parameters correctly.

To get some initial test coverage, the preexisting IRGen/partial_apply.sil and IRGen/partial_apply_forwarder.sil tests have been duplicated into the async folder. Those tests cases within these files which happened to have been crashing have each been extracted into its own runnable test that both verifies that the compiler does not crash and also that the partial application forwarder behaves correctly. The FileChecks in these tests are extremely minimal, providing only enough information to be sure that arguments are in fact squeezed into an async context.

+2414 -212

0 comment

21 changed files

pr created time in 6 days

create barnchnate-chandler/swift

branch : concurrency/irgen/partial-apply

created branch time in 6 days

pull request commentapple/llvm-project

[Coroutines] Reuse storage for local variables with non-overlapping lifetimes

@swift-ci please test

nate-chandler

comment created time in 12 days

pull request commentapple/llvm-project

[Coroutines] Reuse storage for local variables with non-overlapping lifetimes

Cherry-pick of https://reviews.llvm.org/rGb3a722e66b7

nate-chandler

comment created time in 12 days

PR opened apple/llvm-project

[Coroutines] Reuse storage for local variables with non-overlapping lifetimes

bug 45566 shows the process of building coroutine frame won't consider that the lifetimes of different local variables are not overlapped, which means the compiler could generates smaller frame.

This patch calculate the lifetime range of each alloca by StackLifetime class. Then the patch build non-overlapped sets for allocas whose lifetime ranges are not overlapped. We use the largest type in a non-overlapped set as the field type in the frame. In insertSpills process, if we find the type of field is not the same with the alloca, we cast the pointer to the field type to the pointer to the alloca type. Since the lifetime range of alloca in one non-overlapped set is not overlapped with each other, it should be ok to reuse the storage space in the frame.

Test plan: check-llvm, check-clang, cppcoro, folly

Reviewers: junparser, lxfind, modocache

Differential Revision: https://reviews.llvm.org/D87596

+534 -30

0 comment

12 changed files

pr created time in 12 days

create barnchnate-chandler/llvm-project

branch : cherrypick/b3a722e66b75

created branch time in 12 days

push eventapple/swift

Nate Chandler

commit sha 6fce6d9363dee7c3675f94635453a46507e26821

[Async CC] Pull poly params from entry point emission. Previously, EmitPolymorphicParameters dealt directly with an Explosion from which it pulled values. In one place, there was a conditional check for async which handled some cases. There was however another place where the polymorphic parameter was pulled directly from the explosion. That missed case resulted in attempting to pull a polymorphic parameter directly from an Explosion which contains only a %swift.context* per the async calling convention. Here, those parameters are now pulled from an EntryPointArgumentEmission subclasses of which are able to provide the relevant definition of what pulling a parameter means. rdar://problem/70144083

view details

nate-chandler

commit sha c9115dc7c51ccd9bfbed1dc8742c0d863cee5c19

Merge pull request #34277 from nate-chandler/concurrency/irgen/thread-emission-through-emit-polymorphic [Async CC] Pull polymorphic parameters from entry point emission.

view details

push time in 14 days

delete branch nate-chandler/swift

delete branch : concurrency/irgen/thread-emission-through-emit-polymorphic

delete time in 14 days

PR merged apple/swift

[Async CC] Pull polymorphic parameters from entry point emission.

Previously, EmitPolymorphicParameters dealt directly with an Explosion from which it pulled values. In one place, there was a conditional check for async which handled some cases. There was however another place where the polymorphic parameter was pulled directly from the explosion. That missed case resulted in attempting to pull a polymorphic parameter directly from an Explosion which contains only a %swift.context* per the async calling convention.

Here, those parameters are now pulled from an EntryPointArgumentEmission subclasses of which are able to provide the relevant definition of what pulling a parameter means.

rdar://problem/70144083

+116 -57

1 comment

5 changed files

nate-chandler

pr closed time in 14 days

pull request commentapple/swift

[Async CC] Pull poly params from entry point emission.

@swift-ci please test

nate-chandler

comment created time in 14 days

PR opened apple/swift

[Async CC] Pull poly params from entry point emission.

Previously, EmitPolymorphicParameters dealt directly with an Explosion from which it pulled values. In one place, there was a conditional check for async which handled some cases. There was however another place where the polymorphic parameter was pulled directly from the explosion. That missed case resulted in attempting to pull a polymorphic parameter directly from an Explosion which contains only a %swift.context* per the async calling convention.

Here, those parameters are now pulled from an EntryPointArgumentEmission subclasses of which are able to provide the relevant definition of what pulling a parameter means.

rdar://problem/70144083

+116 -57

0 comment

5 changed files

pr created time in 14 days

push eventapple/swift

Nate Chandler

commit sha b33b4f05bb79f51dc908b5c6c46eb4ec46ebc272

[Test] Ensure linked dylib is copied to devices. The tests IRGen/async/run-* all link against a PrintShims dylib. To force that dylib to be copied onto devices running these tests, add the dylib's path to the %target-run line.

view details

nate-chandler

commit sha 7b64c07d6a37b229b5885a67879dca4858483cb0

Merge pull request #34221 from nate-chandler/concurrency/irgen/test-copies-dylib [Test] Ensure linked dylib is copied to devices.

view details

push time in 19 days

PR merged apple/swift

[Test] Ensure linked dylib is copied to devices.

Based on https://github.com/apple/swift/pull/34211 which adds all the commits here but the last.

The tests IRGen/async/run-* all link against a PrintShims dylib. To force that dylib to be copied onto devices running these tests, add the dylib's path to the %target-run line.

+405 -128

2 comments

25 changed files

nate-chandler

pr closed time in 19 days

push eventapple/swift

Nate Chandler

commit sha b90cab6f1b5e7cb2ccb8b123e7fa5a00d022182c

[NFC] Made indexing on AsyncContextLayout private. Previously the methods for getting the index into the layout were public and were being used to directly access the underlying buffer. Here, that abstraction leakage is fixed and field access is forced to go through the appropriate methods.

view details

Nate Chandler

commit sha f6bfd416aba04a75da4ea7ab017e7a07665d4102

[NFC] Use TypeInfo for indirect return storage. Previously a raw CreateLoad was used, which happened to be fine. Here, a TI is used, explicitly clarifying that the indirect return is taken.

view details

Nate Chandler

commit sha d5d65b0dff6a5a027653a84a846baae33c123f55

[NFC] Removed unused method.

view details

Nate Chandler

commit sha eba39cffe6ee2ad3602ac209359c4ffb5065a5b0

[Concurrency] Corrected ordering of indirect results. Previously, the indirect results were claimed from the explosion after the arguments were claimed. That failed to match the order in which arguments actually appear in the explosion. Here the order is reversed.

view details

Nate Chandler

commit sha 7d74a8614db13b3821f85d77c4fdcf511c8cbf15

[Concurrency] Async CC supports witness methods. Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

view details

Nate Chandler

commit sha 0a5df673edce66633e41215cc0d2a44891d3d29d

[NFC] Deduped async entry point emission code. Previously the same code was used for loading values from the async context. Here, that same code is extracted into a private method.

view details

Nate Chandler

commit sha 6e0d89432533b29311d7f1afcdae360aa81b1f61

[NFC] Deduped async call emission code. Previously the same code was used for saving values into the async context. Here, that code is extracted into a private method.

view details

Nate Chandler

commit sha 4c298db5297f88f3eba35d03063847494befa41b

[NFC] Extracted async call emission loading. Previously the code for loading indirect returns was inline in the member function where it was performed. Here it is pulled out into a private method.

view details

nate-chandler

commit sha d32b9350b27fa3942031215a885f1705a4e09e04

Merge pull request #34211 from nate-chandler/concurrency/irgen/protocol-witness-methods [Async CC] Support for protocol witness methods.

view details

push time in 19 days

PR merged apple/swift

[Async CC] Support for protocol witness methods.

Based on https://github.com/apple/swift/pull/34200 .

Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

Additionally, corrected ordering of indirect results. Previously, the indirect results were claimed from the explosion after the arguments were claimed. That failed to match the order in which arguments actually appear in the explosion. Here the order is reversed.

+534 -149

1 comment

10 changed files

nate-chandler

pr closed time in 19 days

pull request commentapple/swift

[Test] Ensure linked dylib is copied to devices.

@swift-ci please smoke test windows platform

nate-chandler

comment created time in 19 days

pull request commentapple/swift

[Test] Ensure linked dylib is copied to devices.

@swift-ci please smoke test

nate-chandler

comment created time in 19 days

PR opened apple/swift

[Test] Ensure linked dylib is copied to devices.

Based on https://github.com/apple/swift/pull/34211 which adds all the commits here but the last.

The tests IRGen/async/run-* all link against a PrintShims dylib. To force that dylib to be copied onto devices running these tests, add the dylib's path to the %target-run line.

+405 -128

0 comment

25 changed files

pr created time in 19 days

create barnchnate-chandler/swift

branch : concurrency/irgen/test-copies-dylib

created branch time in 19 days

push eventapple/swift

Nate Chandler

commit sha d2fc2c1e35dc53870d511555e8d12f20bd32cdae

[IRGen] Silenced unused variable warning.

view details

Nate Chandler

commit sha 15d90d8f5bae9ad4cc8949b05f017f55a93431f9

[IRGen] Pull async polymorphic params from explosion. Previously, the polymorphic arguments were being discarded. Here, that situation is improved by pulling the polymorphic arguments out of the explosion when having the polymorphic parameters via the NecessaryBindings instance. In order to eanble that, an overload of NecessaryBindings::save is added which takes an explosion and asserts that the polymorphic parameter pulled from the explosion matches with the polymorphic parameter in the NecessaryBindings instance.

view details

Nate Chandler

commit sha 1a106d329fc4718a8ff5746ab174309a642d315f

[NFC] Tweaked name of NecessaryBindings factory method.

view details

Nate Chandler

commit sha 72051efa034a1cd28bdbe3b7d09dcfeaeb7b3584

[Concurrency] Async CC for protocol extension methods. Use the TypeInfo for the argument lowering type of the self parameter rather than for the self parameter's type itself.

view details

nate-chandler

commit sha 1af9977bce24a248b792d152cfe84b03581a7987

Merge pull request #34200 from nate-chandler/concurrency/irgen/protocol-extension-methods [Async CC] Support for protocol extension methods.

view details

push time in 20 days

delete branch nate-chandler/swift

delete branch : concurrency/irgen/protocol-extension-methods

delete time in 20 days

PR merged apple/swift

[Async CC] Support for protocol extension methods.

To support, consumed polymorphic arguments out of the argument explosion and used the argument lowering type of the self parameter.

+155 -47

6 comments

5 changed files

nate-chandler

pr closed time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol witness methods.

@swift-ci please test

nate-chandler

comment created time in 20 days

PR opened apple/swift

[Async CC] Support for protocol witness methods.

Based on https://github.com/apple/swift/pull/34200 .

Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

Additionally, corrected ordering of indirect results. Previously, the indirect results were claimed from the explosion after the arguments were claimed. That failed to match the order in which arguments actually appear in the explosion. Here the order is reversed.

+534 -149

0 comment

10 changed files

pr created time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha eba39cffe6ee2ad3602ac209359c4ffb5065a5b0

[Concurrency] Corrected ordering of indirect results. Previously, the indirect results were claimed from the explosion after the arguments were claimed. That failed to match the order in which arguments actually appear in the explosion. Here the order is reversed.

view details

Nate Chandler

commit sha 7d74a8614db13b3821f85d77c4fdcf511c8cbf15

[Concurrency] Async CC supports witness methods. Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

view details

Nate Chandler

commit sha 0a5df673edce66633e41215cc0d2a44891d3d29d

[NFC] Deduped async entry point emission code. Previously the same code was used for loading values from the async context. Here, that same code is extracted into a private method.

view details

Nate Chandler

commit sha 6e0d89432533b29311d7f1afcdae360aa81b1f61

[NFC] Deduped async call emission code. Previously the same code was used for saving values into the async context. Here, that code is extracted into a private method.

view details

Nate Chandler

commit sha 4c298db5297f88f3eba35d03063847494befa41b

[NFC] Extracted async call emission loading. Previously the code for loading indirect returns was inline in the member function where it was performed. Here it is pulled out into a private method.

view details

push time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please clean test linux

nate-chandler

comment created time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha a3091f541684ca351633e193410a6e78e1a2f418

[NFC] Deduped async call emission code. Previously the same code was used for saving values into the async context. Here, that code is extracted into a private method.

view details

Nate Chandler

commit sha b713e91ddc884b5727f0a80cc71910a60f6d1a81

[NFC] Extracted async call emission loading. Previously the code for loading indirect returns was inline in the member function where it was performed. Here it is pulled out into a private method.

view details

push time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha d2fc2c1e35dc53870d511555e8d12f20bd32cdae

[IRGen] Silenced unused variable warning.

view details

Nate Chandler

commit sha 15d90d8f5bae9ad4cc8949b05f017f55a93431f9

[IRGen] Pull async polymorphic params from explosion. Previously, the polymorphic arguments were being discarded. Here, that situation is improved by pulling the polymorphic arguments out of the explosion when having the polymorphic parameters via the NecessaryBindings instance. In order to eanble that, an overload of NecessaryBindings::save is added which takes an explosion and asserts that the polymorphic parameter pulled from the explosion matches with the polymorphic parameter in the NecessaryBindings instance.

view details

Nate Chandler

commit sha 1a106d329fc4718a8ff5746ab174309a642d315f

[NFC] Tweaked name of NecessaryBindings factory method.

view details

Nate Chandler

commit sha 72051efa034a1cd28bdbe3b7d09dcfeaeb7b3584

[Concurrency] Async CC for protocol extension methods. Use the TypeInfo for the argument lowering type of the self parameter rather than for the self parameter's type itself.

view details

Nate Chandler

commit sha b90cab6f1b5e7cb2ccb8b123e7fa5a00d022182c

[NFC] Made indexing on AsyncContextLayout private. Previously the methods for getting the index into the layout were public and were being used to directly access the underlying buffer. Here, that abstraction leakage is fixed and field access is forced to go through the appropriate methods.

view details

Nate Chandler

commit sha f6bfd416aba04a75da4ea7ab017e7a07665d4102

[NFC] Use TypeInfo for indirect return storage. Previously a raw CreateLoad was used, which happened to be fine. Here, a TI is used, explicitly clarifying that the indirect return is taken.

view details

Nate Chandler

commit sha d5d65b0dff6a5a027653a84a846baae33c123f55

[NFC] Removed unused method.

view details

Nate Chandler

commit sha 057c69fb19810bfa60be06ccb2e5fc304a35b383

[Concurrency] Async CC supports witness methods. Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

view details

Nate Chandler

commit sha ffb491d89069c0e13b80f7b950e5185af6137781

[NFC] Deduped async entry point emission code. Previously the same code was used for loading values from the async context. Here, that same code is extracted into a private method.

view details

Nate Chandler

commit sha 9aae474b43bda378b39b55c4b0224f9b1a564d88

[NFC] Deduped async call emission code. Previously the same code was used for saving values into the async context. Here, that code is extracted into a private method.

view details

push time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please test windows

nate-chandler

comment created time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please test and merge

nate-chandler

comment created time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha d2fc2c1e35dc53870d511555e8d12f20bd32cdae

[IRGen] Silenced unused variable warning.

view details

Nate Chandler

commit sha 15d90d8f5bae9ad4cc8949b05f017f55a93431f9

[IRGen] Pull async polymorphic params from explosion. Previously, the polymorphic arguments were being discarded. Here, that situation is improved by pulling the polymorphic arguments out of the explosion when having the polymorphic parameters via the NecessaryBindings instance. In order to eanble that, an overload of NecessaryBindings::save is added which takes an explosion and asserts that the polymorphic parameter pulled from the explosion matches with the polymorphic parameter in the NecessaryBindings instance.

view details

Nate Chandler

commit sha 1a106d329fc4718a8ff5746ab174309a642d315f

[NFC] Tweaked name of NecessaryBindings factory method.

view details

Nate Chandler

commit sha 72051efa034a1cd28bdbe3b7d09dcfeaeb7b3584

[Concurrency] Async CC for protocol extension methods. Use the TypeInfo for the argument lowering type of the self parameter rather than for the self parameter's type itself.

view details

push time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha 13ffa97b076e92ff693dfb7c3e639d50a4c642c7

[NFC] Deduped async call emission code. Previously the same code was used for saving values into the async context. Here, that code is extracted into a private method.

view details

push time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha 0ed81c5f85d80ca6bdc4da14dda73234e966d260

[Concurrency] Async CC supports witness methods. Previously, the AsyncContextLayout did not make space for the trailing witness fields (self metadata and self witness table) and the AsyncNativeCCEntryPointArgumentEmission could consequently not vend these fields. Here, the fields are added to the layout.

view details

Nate Chandler

commit sha 2f8ba9eebb0cfae09dd33fa6461889eb0993da02

[NFC] Deduped async entry point emission code. Previously the same code was used for loading values from the async context. Here, that same code is extracted into a private method.

view details

push time in 20 days

create barnchnate-chandler/swift

branch : concurrency/irgen/protocol-witness-methods

created branch time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please test windows

nate-chandler

comment created time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please test and merge

nate-chandler

comment created time in 20 days

pull request commentapple/swift

[Async CC] Support for protocol extension methods.

@swift-ci please test and merge

nate-chandler

comment created time in 20 days

PR opened apple/swift

[Async CC] Support for protocol extension methods.

To support, consumed polymorphic arguments out of the argument explosion and used the argument lowering type of the self parameter.

+135 -35

0 comment

5 changed files

pr created time in 20 days

push eventnate-chandler/swift

Nate Chandler

commit sha e8f56774c07ffc8a791dc8ad683ca5fdd92186af

[Concurrency] Async CC for protocol extension methods. Use the TypeInfo for the argument lowering type of the self parameter rather than for the self parameter's type itself.

view details

push time in 20 days

delete branch nate-chandler/swift

delete branch : concurrency/irgen/signature

delete time in 20 days

push eventapple/swift

Nate Chandler

commit sha 4cfadfae00f31fc66581ad270176e4916682bf51

[NFC] Documented IRGenFunction::IndirectReturn.

view details

Nate Chandler

commit sha 607772aaa21ce58db04236cb817b5958c72b2123

[Runtime] Stubbed entry points for task de/alloc.

view details

Nate Chandler

commit sha 59bb1fc23592bcc4eb18bca32dcbff9de4b7e751

[Concurrency] Pass "async" into SILFunctionTypes. This reverts commit 3a48396110d2639d7b90970bc0369a559adbc0c1.

view details

Nate Chandler

commit sha ee88152d6baa1bef03790d3e6acfa7448ef467f3

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

nate-chandler

commit sha 515f0db4edaaa505ec0af635430feac2dfce0be0

Merge pull request #34141 from nate-chandler/concurrency/irgen/signature [Concurrency] Async CC, part 1.

view details

push time in 20 days

PR merged apple/swift

Reviewers
[Concurrency] Async CC, part 1.

Here, the following is implemented:

  • Construction of SwiftContext struct with the fields needed for calling functions.
  • Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them.
  • Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct (however the convention is currently ignorend) and indirect).
  • Wrangling errors.

Additional things that still need to be done:

  • interaction between async function contexts and coroutine contexts
  • yields from async functions
  • partial applies of async functions

To support, a couple of structural changes were helpful:

  • addition of a small EntryPointCallingConvention class hierarchy
  • addition of a couple of subclasses of CallEmission
+2976 -324

30 comments

41 changed files

nate-chandler

pr closed time in 20 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test windows

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test

nate-chandler

comment created time in 21 days

push eventnate-chandler/swift

Nate Chandler

commit sha ee88152d6baa1bef03790d3e6acfa7448ef467f3

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

push time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test linux

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test linux

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please clean test linux

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test linux

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test windows

nate-chandler

comment created time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test

nate-chandler

comment created time in 21 days

push eventnate-chandler/swift

Nate Chandler

commit sha a4eb7e50b3a6c375888430cde4344eebc4a02997

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

push time in 21 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test

nate-chandler

comment created time in 21 days

push eventnate-chandler/swift

Nate Chandler

commit sha 1c38310901d0559e9dc35c56602b987409be92f2

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

push time in 21 days

push eventnate-chandler/swift

Nate Chandler

commit sha 3ffb05c0da6f203f7d9bc3c83e8f1e556e9d9e09

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

push time in 22 days

push eventnate-chandler/swift

Nate Chandler

commit sha ec4430cc1ca24d3a467195a4c254d42071550fb6

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - protocol extension methods - protocol witness methods - storing yields - partial applies

view details

push time in 22 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please asan test

nate-chandler

comment created time in 24 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test windows

nate-chandler

comment created time in 24 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test

nate-chandler

comment created time in 24 days

push eventnate-chandler/swift

Nate Chandler

commit sha ee3d1d1a305392bae3ee32dcaff529b7a793df0c

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - yields from async functions - partial applies of async functions

view details

push time in 24 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test windows

nate-chandler

comment created time in 24 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please asan test

nate-chandler

comment created time in 24 days

pull request commentapple/swift

[Concurrency] Async CC, part 1.

@swift-ci please test

nate-chandler

comment created time in 24 days

push eventnate-chandler/swift

Nate Chandler

commit sha 08dc8a2d831e6e4f0ca88df8306b4e04e59d8d34

[Concurrency] First steps towards async CC. Here, the following is implemented: - Construction of SwiftContext struct with the fields needed for calling functions. - Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them. - Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct and indirect). - Calling async functions. Additional things that still need to be done: - yields from async functions - partial applies of async functions

view details

push time in 24 days

more