davidchisnall wrote:

I’m concerned about the semantics of unstable. This sounds like it would impact 
optimisation of memcmp, for example (is it still allowable to optimise away 
self comparisons?). I wouldn’t want that added to the LangRef without some 
clearer description of what optimisers *can* assume.  That said, given that 
it’s a property that’s already present for NI pointers for GC, I suppose we’re 
stuck with it for now.

Note that CHERI LLVM’s use of ptrtoint is largely historical. We worked with 
the folks doing NI pointers and my plan was to move to them eventually. We 
didn’t initially have the address-get intrinsic and so we abused ptrtoint for 
that, but I believe we’ve fixed the places in the front end that do this. When 
we upstream, we should get rid of that entirely. This also improves 
optimisation because optimisers treat address-get as non-escaping whereas 
ptrtoint assumes the pointer may be materialised anywhere else and makes alias 
analysis conservative.

https://github.com/llvm/llvm-project/pull/105735
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to