[PATCH] D59065: Add ptrmask intrinsic

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 09:22:09 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/include/llvm/IR/Intrinsics.td:1026
+// is used to access memory.
+def int_ptrmask: Intrinsic<[llvm_anyptr_ty], [llvm_anyptr_ty, llvm_anyint_ty], [IntrNoMem]>;
 
----------------
fhahn wrote:
> jdoerfert wrote:
> > Did we think about adding `Returned<0>` to the attribute list? It would most of LLVM simply look through this (as it should).
> I think that would indicate that ptrmask is a no-op, right? That would not be true, it potentially changes the bit value of the pointer, e.g. masking out the data in the lowest bits of a tagged pointer. 
> 
> The intended semantics are that the masking is done in a way that the underlying object the pointer points to is not changed, because it only masks out bits that need to be 0 anyways, when the pointer is used to access memory.
I see. Maybe add it to `stripPointerCasts` then. Btw. D61607 introduces the "keep bit pattern the same" version, something we currently do not strictly enforce.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59065/new/

https://reviews.llvm.org/D59065





More information about the llvm-commits mailing list