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
Introduce the no_preserve_tags_attribute #582
Closed
arichardson
wants to merge
6
commits into
CTSRD-CHERI:dev
from
arichardson:no-preserve-tags-nfc-prep
Closed
Introduce the no_preserve_tags_attribute #582
arichardson
wants to merge
6
commits into
CTSRD-CHERI:dev
from
arichardson:no-preserve-tags-nfc-prep
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arichardson
commented
Oct 15, 2021
This is the opposite of the existing must_preserve_cheri_tags and can be used to indicated that a memcpy/memmove will never copy capabilities and can therefore be inlined even when larger than the capability size and aligned to less than the capability size. The motivating case for this is that we currently call memcpy when performing structure assignment for struct { long a; long b;} rather than using two loads+stores.
Also add a global helper function that can be used to get the attribute from calls to library functions such as memcpy (since those CallInsts are not subclasses of MemTransferInst).
arichardson
force-pushed
the
no-preserve-tags-nfc-prep
branch
from
October 21, 2021 09:09
cb414e3
to
10f4715
Compare
Slightly less churn in this version by adding a default argument. |
Longer-term I am not sure we need the must_preserve_tags attribute anymore since not having the attribute means we have to assume tags are preserved. |
This refactoring is required to allow inlining of non-tag-preserving memcpy instructions with size > sizeof(cap) && alignment < alignof(cap).
…ends This will allow setting the PreserveCheriTags flag in Clang and in optimization passes such as SimplifyLibcalls, etc. This commit only adds the argument with a default value to avoid merge conflicts for passes where we would just pass ::Unknown. Eventually the default argument should be removed but that means we have to audit all current call sites. A follow-up commit will use this flag in the individual backends to ensure that structures without capabilities can be copied efficiently.
This avoids churn in upstream tests due to additional attributes. To check whether we CHERI capabilities are supported, we check whether the DataLayout has any address spaces tagged as fat pointers.
arichardson
force-pushed
the
no-preserve-tags-nfc-prep
branch
from
October 21, 2021 09:16
10f4715
to
f246e9e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Split out from #506 to make that a bit easier to review.