[llvm-dev] RFC: Harvard architectures and default address spaces

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 12 08:26:26 PDT 2017

On 11 Jul 2017, at 23:18, Dylan McKay via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> > Add this information to DataLayout and to use that information in relevant places.
> This sounds like a much better/cleaner idea, thanks!

I’d suggest taking a look at the alloca address space changes, which were recently added based on a cleaned-up version of our code.  We have a similar issue (function and data pointers have the same representation for us, but casting requires different handling[1]) and have considered adding address spaces to functions.


[1] Probably not relevant for this discussion, but if anyone cares: in our world we have 128-bit fat pointers contain base, bounds and permissions, and that 64-bit pointers that are implicitly relative to one of two special fat pointer registers, one for code and one for data.  We must therefore handle 64-bit to 128-bit pointer casts differently depending on whether we’re casting code or data pointers.  We currently do this with some fairly ugly hacks, but being able to put all functions in a different AS would make this much easier for us.

More information about the llvm-dev mailing list