[PATCH] D59065: Add ptrmask intrinsic

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 14:28:04 PDT 2019


jdoerfert added a comment.

In D59065#1497965 <https://reviews.llvm.org/D59065#1497965>, @fhahn wrote:

> In D59065#1497227 <https://reviews.llvm.org/D59065#1497227>, @jdoerfert wrote:
>
> > What happens if I use an integer type bigger than the native pointer width? Or smaller?
>
>
> Initially I wanted to restrict the mask type to the native pointer width, but couldn't find how to do that in Intrinsics.td. On second thought, this might be more restrictive than necessary. I've adjusted the wording to make it clear that we zero-extend or truncate the mask if the bit width does not match the pointer size of the target. What do you think?


The wording makes it clear now (what is supposed to happen at least).

Last points from my side:

- What happened to the poison result sentence. I think we need that to ensure the "based on the same ..." part. Otherwise, we can butcher the pointer with the mask and end up with a "valid pointer" into a different object. I might be wrong here, just want to make sure we have thought of it.
- Can we add the `speculatable` attribute? Executing `ptrmask` should never cause UB (as we agreed on) so we need `speculatable` to express that, right?


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

https://reviews.llvm.org/D59065





More information about the llvm-commits mailing list