[PATCH] D70947: Add a default address space for globals to DataLayout

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 12:49:51 PST 2020


On Fri, Nov 20, 2020 at 3:44 PM Alexander Richardson via Phabricator <
reviews at reviews.llvm.org> wrote:

> arichardson added a comment.
>
> In D70947#2408741 <https://reviews.llvm.org/D70947#2408741>, @echristo
> wrote:
>
> > Why is this useful rather than having targets set the address space used
> in the backend explicitly? i.e. how is what amdgpu was doing up to this
> point not ok? It's not really clear here.
>
> That's fine for globals created in target-specific passes, but other
> passes that create new global variables need to know which address space to
> place them in. In our CHERI fork (using a default address space of 200), we
> got lots of assertion failures/invalid IR due to passes creating globals in
> AS0 (or assuming that all global pointers are AS0) until I added a default
> globals address space to the datalayout so  those passes can choose the
> address space that our target needs. Does that make sense?
>

It does. It highlights a problem that tools aren't forward compatible
though :) I think it's fine, it's just a little annoying.

Arguably this is a major enough change that it should have gone to llvm-dev
as well. Would you mind sending that note letting people know what you've
done? You may get rollback requests, but changing the data layout string is
a major change.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/960efe70/attachment.html>


More information about the llvm-commits mailing list