Skip to content

Add some instruction simplifications to make precondition() not allocate in Onone builds #69401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

eeckstein
Copy link
Contributor

The added instruction simplification rewrite the SIL generated for the precondition's auto-closures.
This allows to use precondition() within @_noAllocation functions.
For details see the commit messages.

rdar://117446413

@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein eeckstein force-pushed the noallocation-with-precondition branch from 0b9b942 to a39b2a4 Compare October 25, 2023 18:24
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci test linux

…ck_function

```
   %2 = thin_to_thick_function %1
   %3 = apply %2(...) : @callee_guaranteed
 ->
   %2 = thin_to_thick_function %1
   %3 = apply %1(...): @convention(thin)
```
…ruction

Including the required bridging stuff.

  %2 = thin_to_thick_function %1 to $() -> ()
  %3 = convert_escape_to_noescape %2 : $() -> () to $@NoEscape () -> ()
->
  %3 = thin_to_thick_function %1 to $@NoEscape () -> ()
…ue in swift

So that they can run in the OnoneSimplification pass
@eeckstein eeckstein force-pushed the noallocation-with-precondition branch from a39b2a4 to d27ca6a Compare October 27, 2023 08:47
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit d011771 into swiftlang:main Oct 27, 2023
@eeckstein eeckstein deleted the noallocation-with-precondition branch October 27, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant