Skip to content

Conversation

@gottesmm
Copy link
Contributor

…clusivity".

This is a special @_semantics attribute that preserves exclusivity even if we
are eliminating exclusivity in other parts of a module in release mode. This is
done by:

  1. Teaching the Access Marker Elimination pass to skip any function with the
    semantics tag.

  2. Requiring all functions with the semantics tag to be noinline. This ensures
    that the SIL level inliner will not inline these functions into any callers
    without the protection of the semantics tag. This is enforced in IRGenPrepare
    and ensures that our access markers will live to IRGen time.

  3. In IRGenPrepare, we convert these functions from noinline to always
    inline. After IRGen this then allows for the LLVM inliner to inline these
    trivial functions that just perform the exclusivity checks ensuring that we do
    not have extra calls in the fast path.

This ensures that we can fix the keypaths exclusivity issue without having to
enable exclusivity across the entire stdlib and deal with any of the potential
performance issues therein.

rdar://39335800

…clusivity".

This is a special @_semantics attribute that preserves exclusivity even if we
are eliminating exclusivity in other parts of a module in release mode. This is
done by:

1. Teaching the Access Marker Elimination pass to skip any function with the
semantics tag.

2. Requiring all functions with the semantics tag to be noinline. This ensures
that the SIL level inliner will not inline these functions into any callers
without the protection of the semantics tag. This is enforced in IRGenPrepare
and ensures that our access markers will live to IRGen time.

3. In IRGenPrepare, we convert these functions from noinline to always
inline. After IRGen this then allows for the LLVM inliner to inline these
trivial functions that just perform the exclusivity checks ensuring that we do
not have extra calls in the fast path.

This ensures that we can fix the keypaths exclusivity issue without having to
enable exclusivity across the entire stdlib and deal with any of the potential
performance issues therein.

rdar://39335800
@gottesmm gottesmm requested a review from atrick April 18, 2018 01:12
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic. Rigorous checks and tests. 🎖

@atrick
Copy link
Contributor

atrick commented Apr 18, 2018

@swift-ci smoke test.

@gottesmm gottesmm closed this Apr 23, 2018
@gottesmm gottesmm deleted the pr-d0d3deaf1a5fb4d9181612035422cdd2972b6a9e branch April 23, 2018 17:06
@gottesmm
Copy link
Contributor Author

See #16051

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.

2 participants