[clang] [lld] [llvm] [mlir] [IR] Introduce `T<address space>` to `DataLayout` to represent flat address space if a target supports it (PR #108786)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 16 13:42:24 PDT 2024
shiltian wrote:
> Just to clarify, does this mean any two non-flat address space pointers _cannot_ alias?
If I read it correctly, it is equivalent to ask, whether an AS X pointer can alias an AS Y pointer, assuming neither X nor Y is the flat address space. I think that is orthogonal to this PR. Whether two pointers from different non-flat address spaces can alias or not is not changed w/ or w/o this PR (or the existence of the flat address space).
There is no any form of alias guarantee between the flat address space and non-flat address space. FWIW, I think the "flat" address space has to be an "alias" of an existing address space, so all the characteristics of the flat address space are same as its "original" address space.
> > Can there be more than one flat address space? No.
>
> Why not? E.g. if we have a processor with Harvard architecture, there may conceivably be multiple 'flat', non-overlapping address spaces, each covering a set of specific ASes.
Well, I can see it theoretically possible, but am not sure about the practice use. Do we support this kind of arch in LLVM?
> "can be used access multiple segments of memory with different AS" -- does it mean all of them? If it covers only some of the segments, which ones?
This would be similar to the question above it. The implementation/target defines which segments it covers.
https://github.com/llvm/llvm-project/pull/108786
More information about the cfe-commits
mailing list