-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Conversation
@swift-ci Please smoke test |
cb4307f
to
268037e
Compare
@swift-ci Please smoke test |
@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. |
268037e
to
0055413
Compare
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
@swiftix I haven't looked at the code, but definitely for benchmarking purposes seems interesting! |
0055413
to
07bed12
Compare
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
On Dec 2, 2016, at 6:07 PM, Roman Levenstein ***@***.***> wrote:
@gottesmm <https://github.com/gottesmm> @atrick <https://github.com/atrick> @aschwaighofer <https://github.com/aschwaighofer> @jckarter <https://github.com/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.
I like having benchmarking options in-tree as long as they’re easily maintainable and unit tested, which this is. So +1.
Is this actually going to catch *all* refcounting operations? e.g. do some runtime calls or builtins do implicit refcounting? If there are any know cases that this doesn’t cover that should be commented in the pass file.
…-Andy
|
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. |
@jckarter Exactly, this is also what I would propose. Either redirect the stubs or even better build a single-threaded variant of the runtime. |
07bed12
to
5782b5c
Compare
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.
5782b5c
to
354fd29
Compare
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
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.