On 11/29/2013 02:05 PM, Kirill Yukhin wrote: > On 29 Nov 13:17, Bernd Schmidt wrote: >> 5. There's a new DECL_TARGET which refers to this list of target >> machines. It's set when creating a child function from e.g. "#pragma acc >> parallel" > Actually, I do not understand, what term `target machine' means here. > Are you talking about to target toolchain (target compiler, assembler, linker, > libraries etc)?
The idea is that if an x86-linux toolchain is configured with --enable-accelerator=nvptx, there would be two machines in the list - the normal host, x86-linux, and nvptx. We can directly generate code for the normal host, and everything else goes through lto writeout -> lto_wrapper -> target gcc/lto1. >> 6. ipa_write_summaries iterates over DECL_TARGET machines to write out >> LTO for each of them. LTO sections for a different target get a separate >> prefix encoding the machine name, e.g. ".gnu.tlto_nvptx_...". > Why we want separate sections for different targets? As far as I understand > this is going to be generic Gimple, which should be identical to PTX, MIC etc. > We cannot use target built-ins inside such a common regions, right? But they need to be read in by a different compiler and fed to the appropriate nvptx-none lto1. I imagine the easiest way to do this is to encode the name in the section and then call multiple different gcc frontends from lto-wrapper, so that's what I've been working towards. > I also think it worst saying that currently we're working on passing of > omp_target > sections to target compiler (we call it `streaming in') so we can produce > target > objects from lto sections containing IR marked to be `target'. > Multiple targets are handled by means of dedicated targets descriptor, > containing vector of > target compilers which will be executed on given sections one-by-one > producing set > of objects for every target. > This sections are not related on exact target, as I mentioned above. None of this has been posted yet, correct? If it has, can you point me at the right place in the archive? Bernd