[libcxx-commits] [clang] [libcxx] [clang & libcxx] constexpr pointer tagging (DO NOT MERGE) (PR #111861)
Hana Dusíková via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 10 12:16:45 PDT 2024
hanickadot wrote:
> Hmm, so needs to somehow allow accessing bits that aren't low bits?
yes, for example upper byte on aarch64
> As a general comment not specific to this patch, I'd prefer to build around llvm.ptrmask and geps as much as possible, as opposed to relying on ptrtoint.
I 100% agree, I have my partially working version which is using ptr.mask and a new intrinsic for tagging. But I wasn't able to finish it. But if ever this functionality will get in, it should not be implemented with ptrtoint. And that's the point of the proposal, to avoid cast via number.
> Oh, hmm, I guess the cases where comparisons are actually legal is pretty restrictive; maybe you're mostly okay here. Maybe less so if the constexpr restrictions on pointer casts ever get relaxed...
My intention is a normal user shouldn't interact with raw tagged pointer, only if they need to interact with existing pointer tagging facility via `.unsafe_dirty_pointer()` and I can specify it that dereferencing and comparing such pointers is implementation specific.
https://github.com/llvm/llvm-project/pull/111861
More information about the libcxx-commits
mailing list