[LLVMdev] RFC: Are we ready to completely move away from the optionality of a DataLayout?

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue Oct 21 01:26:56 PDT 2014

On 21 Oct 2014, at 06:17, Robinson, Paul <Paul_Robinson at playstation.sony.com> wrote:

> Attaching a single DataLayout to the Module
> would seem to require that these guys both use the same DataLayout; is that
> really how things work in the real world?

Yes and no.  In the general case, no.  In the specific case where you want to do this kind of outlining, more or less.  At least, you want to make sure that they use the same struct layouts and pointer sizes because, to get any benefit from the accelerator, you don't want to have to do complex operations when handing data off to it (and you do want it to be able to access your memory directly).  In these cases, you want to ignore any ABI that the accelerator might have 'natively' and force it to use the host's data layout (although its own internal calling conventions, but that's not part of the data layout.  Unfortunately, it *is* something that we don't sanely abstract in the IR, which makes this kind of thing difficult).


More information about the llvm-dev mailing list