[PATCH] D31042: Allow DataLayout to specify addrspace for allocas.

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 10:44:43 PDT 2017


rjmccall added a comment.

In https://reviews.llvm.org/D31042#712292, @efriedma wrote:

> > Do you actually need this to be printed/parsed in .ll files? It's globally consistent across all alloca instructions, and the data layout is always parsed before anything else in the file. It's not the end of the world, just seems odd to imply that this is actually something that can be different on different instructions.
>
> No, strictly speaking it isn't necessary: every module has a datalayout, so we can compute the type from that.  I requested it to make debugging more straightforward. Without it, there isn't any obvious indication if you dump() an instruction or look at an IR file that the address-space of the result is non-zero.


Well, since IR assembly is primarily a debugging / testing aid, and you won't get similar test output anyway because the address space will show up in every use of the instruction, I suppose it's fine.


https://reviews.llvm.org/D31042





More information about the llvm-commits mailing list