[PATCH] D64128: [CodeGen] Generate llvm.ptrmask instead of inttoptr(and(ptrtoint, C)) if possible.
Alexander Richardson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 15 02:26:42 PST 2019
arichardson added a comment.
In D64128#1576391 <https://reviews.llvm.org/D64128#1576391>, @rjmccall wrote:
> I wouldn't favor adding something really obscure that was only useful for clang, but I think builtins to set and clear mask bits while promising to preserve object-reference identity would be more generally useful for libraries. For example, there might be somewhere in libc++ that could take advantage of this.
This would be very useful for CHERI since in our architecture pointers (capabilties) carry provenance information at runtime.
The bitwise operations used by default sometimes make it unclear which provenance we should should use: should the resulting value be a capability derived from the LHS or RHS?
Checking the value of low bits is especially awkward since it that case we would expect the result to be an invalid uintptr_t (derived from NULL instead of the LHS/RHS uintptr_t).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64128/new/
https://reviews.llvm.org/D64128
More information about the cfe-commits
mailing list