[llvm] AtomicExpand: Fix creating invalid ptrmask for fat pointers (PR #94955)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 09:04:13 PDT 2024


jrtc27 wrote:

> > Right, this currently avoids a verifier error and in theory should work.
> 
> It's certainly clear that getIndexType is the correct type for ptrmask. So, this change is definitely "more correct" in that regards. But it's less clear to me (yet) that this code will actually work on architectures where there's a relevant difference.
> 
> > It’s written to the IR model that the address is in the low bits
> 
> Where is that in the LangRef?
> 
> I always thought it should be the case, but I don't see where it says that it is. The behavior of ptrmask is specified in terms of ptrtoint. And ptrtoint doesn't seem to say anything about the low-bits of the result representing the low-bits of the underlying address?

There's a lot that isn't there that should be, but that shouldn't prevent us from incremental improvement like this. In terms of ptrtoint being used, that's just because there is no standard LLVM way to get just the address without using the complication that is ptrtoint's semantics.

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


More information about the llvm-commits mailing list