[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

Alexander Richardson via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 16 10:53:18 PDT 2023


arichardson wrote:

> > Since the langref definition is based on GEP, can we use index width instead of pointer width? If you disagree with this, it would still be good if you could add a test where the datalayout has index width < pointer width to show the current semantics.
> 
> Any target inmind? But I think ptrwidth makes more sense given that the result is a pointer. It would be awkward to have resize things like knownbits / etc... and would somewhat make ptrmask useless as basically any mask would result in a low-bit only pointer.

Since this is target-independent I was just thinking using something like `-p1:64:64:64:32` for a 64-bit size pointer with 32-bit address range (which would match CHERI on 32-bit systems). In-tree I see AMDGPU has `-p7:160:256:256:32`.

https://github.com/llvm/llvm-project/pull/67166


More information about the cfe-commits mailing list