Skip to content

Add a new -assume-single-threaded option #6041

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 1 commit into from
Dec 5, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Dec 2, 2016

This is a hidden option. It should be used like: -assume-single-threaded

When this function is provided, the compiler assumes that the code will be executed in the single threaded mode. It then performs certain optimizations that can benefit from it, e.g. it marks as non-atomic all reference counting instructions in the user code being compiled.

@swiftix
Copy link
Contributor Author

swiftix commented Dec 2, 2016

@swift-ci Please smoke test

@swiftix swiftix force-pushed the wip-single-threaded-app-flag branch from cb4307f to 268037e Compare December 3, 2016 01:47
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

2 similar comments
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@gottesmm @atrick @aschwaighofer @jckarter Should I merge this commit? It can be a useful option for testing, benchmarking, etc. WDYT?

The option is hidden and is not supposed to be used by users as a regular option.

@swiftix swiftix force-pushed the wip-single-threaded-app-flag branch from 268037e to 0055413 Compare December 3, 2016 16:46
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

@gottesmm
Copy link
Contributor

gottesmm commented Dec 3, 2016

@swiftix I haven't looked at the code, but definitely for benchmarking purposes seems interesting!

@swiftix swiftix force-pushed the wip-single-threaded-app-flag branch from 0055413 to 07bed12 Compare December 3, 2016 22:13
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Dec 3, 2016

@swift-ci Please smoke test

@atrick
Copy link
Contributor

atrick commented Dec 4, 2016 via email

@jckarter
Copy link
Contributor

jckarter commented Dec 5, 2016

It wouldn't affect places in the runtime C++ code where we hardcode calls to retain/release. We could take advantage of the Instruments instrumentation stubs to redirect calls from the runtime if it was significant, or else just build a single-threaded variant of the runtime.

@swiftix
Copy link
Contributor Author

swiftix commented Dec 5, 2016

@jckarter Exactly, this is also what I would propose. Either redirect the stubs or even better build a single-threaded variant of the runtime.

@swiftix swiftix force-pushed the wip-single-threaded-app-flag branch from 07bed12 to 5782b5c Compare December 5, 2016 18:05
This is a hidden option. It should be used like: -assume-single-threaded

When this function is provided, the compiler assumes that the code will be executed in the single threaded mode. It then performs certain optimizations that can benefit from it, e.g. it  marks as non-atomic all reference counting instructions in the user code being compiled.
@swiftix swiftix force-pushed the wip-single-threaded-app-flag branch from 5782b5c to 354fd29 Compare December 5, 2016 18:05
@swiftix
Copy link
Contributor Author

swiftix commented Dec 5, 2016

@swift-ci Please smoke test

1 similar comment
@swiftix
Copy link
Contributor Author

swiftix commented Dec 5, 2016

@swift-ci Please smoke test

@swiftix swiftix merged commit 2e03a56 into swiftlang:master Dec 5, 2016
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.

4 participants