This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Target compilation for offloading
- From: Andrey Turetskiy <andrey dot turetskiy at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Ilya Verbin <iverbin at gmail dot com>, michael dot v dot zolotukhin at gmail dot com, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 15 Nov 2013 19:45:36 +0400
- Subject: Re: [RFC] Target compilation for offloading
- Authentication-results: sourceware.org; auth=none
- References: <CADB16ZApSvg2gMGJTDjQhDmEwxb1y4pyn-k16fhxiV7ZpW46=g at mail dot gmail dot com> <20131029094930 dot GW30970 at tucnak dot zalov dot cz> <CADB16ZCa62Y+wZMO0yMzXAxSNttOJG35Aydk6MxqPsLNYqD8Dw at mail dot gmail dot com> <CADB16ZCLqJW7LhBrb8rk0xpY7gCBp7_9WfxMo+mo5ZtW-Lq-ig at mail dot gmail dot com> <20131106140045 dot GB27813 at tucnak dot zalov dot cz> <CADB16ZBnheNNw_F2uGjfMnX-6tR6Es5DGjch4Kp1+tW_6=CtpA at mail dot gmail dot com> <20131107154217 dot GG27813 at tucnak dot zalov dot cz> <CADB16ZB9rpgdtACZi0YxV0a3rCTy_PN9RSZty4=FW49Q1uA=tQ at mail dot gmail dot com> <20131108143444 dot GO27813 at tucnak dot zalov dot cz>
Let's suppose, we are going to run target gcc driver from lto-wrapper.
How could a list of offload targets be passed there from option
In my opinion, the simpliest way to do it is to use environment
variable. Would you agree with such approach?
On Fri, Nov 8, 2013 at 6:34 PM, Jakub Jelinek <firstname.lastname@example.org> wrote:
> On Fri, Nov 08, 2013 at 06:26:53PM +0400, Andrey Turetskiy wrote:
>> And a few questions about compiler options:
>> 1) You've mentioned two options for offloading:
>> -foffload-target=<set of targets> - to specify targets for offloading
>> -foffload-target-<target name>=<set of options> - to specify
>> compiler options for different targets
>> Do we really need two options to set up offloading?
>> What do you think about, in my opinion, more compact way:
>> -foffload-<target name> - if I want to offload for 'target name',
>> but I don't want to specify any options
>> -foffload-<target-name>=<set of options> - enable offloading for
>> 'target name' and set options
>> And compilation for several targets would look like:
>> gcc -fopenmp -foffload-mic="-O3 -msse -m64" -foffload-ptx
>> -foffload-hsail="-O2 -m32" file.c
> I don't think it is a good idea to include the target name before =
> in the name of the option, but perhaps you can use two =s:
> -foffloat-target=x86_64-k1om-linux="-O2 -mtune=foobar' -foffloat-target=ptx-none
>> 2) If user doesn't specify target options directly, is target
>> compilation done without any option or compiler uses those host
>> options which are suitable for target?
> I think I've said that earlier, non-target specific options from original
> compilation should be copied over, target specific options discarded,
> and the command line supplied overrides appended to that.
>> 3) Am I understand right, that options for different targets should be
>> stored in different sections in fat object file, and than lto frontend
>> should read theese options and run target compilation with them?
> No, I'd store in the LTO target IL only the original host compilation
> options that weren't target specific (opt* has some flags what is target
> specific and what is not), so say -O2 -ftree-vrp would go there,
> but say -march=corei7-avx would not. And the -foffload-target= options
> would only matter during linking.