Skip to content

[region-isolation] Add support for more instructions. #70562

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 5 commits into from
Dec 20, 2023

Conversation

gottesmm
Copy link
Contributor

Just adding support for more instructions. The only truly interesting change of note is that to handle unchecked_trivial_bit_cast (which we have to handle since RawPointer is considered non-Sendable) I had to inline getUnderlyingObject into getUnderlyingTrackedObject since the former API unconditionally looks through the cast... we can only look through the cast if both the source/dest are non-Sendable.

The instructions I added support for were specifically:

  1. *_existential_box instructions.
  2. ref_to_raw_pointer, raw_pointer_to_ref, index_raw_pointer.
  3. unchecked_trivial_bit_cast
  4. unchecked_bitwise_cast
  5. unchecked_value_cast

NOTE: I am just adding coverage that we support these instructions. One can only
use this with Error today and Error is always Sendable. So this is just going
for completeness.
NOTE: This required me to stop using swift::getUnderlyingObject from
getUnderlyingTrackedObject since when it stripsCasts it looks through
unchecked_trivial_bit_cast... but we only want to do that if both the operand
and result of the instruction are non-Sendable. To fix this I inlined
getUnderlyingObject's impl and removed that part of stripCasts.
Just followed the model of unchecked_trivial_bit_cast.
@gottesmm gottesmm requested review from ktoso and kavon as code owners December 20, 2023 18:31
@gottesmm gottesmm requested review from slavapestov and removed request for ktoso and kavon December 20, 2023 18:31
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

Slava wants to do post-commit review.

@gottesmm gottesmm merged commit 04abdb1 into swiftlang:main Dec 20, 2023
@gottesmm gottesmm deleted the more-code-coverage branch December 20, 2023 21:23
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