But re the proposal, I think the out-of-band metadata thing (which we don’t have and it sounds like CHERI does) could be encoded in a third flag - a pointer is structural if the types of the operations on the pointer are significant and can’t be mutated by the compiler.
That is, you can’t rewrite loads from or stores to structural pointers into ones of different types, optimize them to byte copies, etc.
On our side, I think (and @piotr @jayfoad for graphics context) this might be a useful invariant for ptr addrspace(9), which is a <{ptr addrspace(8), i32 index, i32 offset} which has complex addressing semantics (the index and offset part might be swizzled) and, since we’re dealing in texture fetch operations, might needs its loaded types kept unaltered.
I don’t know if that’s too strong an invariant for our use-cases, or if it’d be sufficient to preserve out of band metadata, but it seems worth adding as a third flag.