On Thu, Nov 20, 2014 at 01:27:08PM +0100, Bernd Schmidt wrote: > On 11/13/2014 05:06 AM, Jan Hubicka wrote: > >this patch adds infrastructure for proper streaming and merging of > >TREE_TARGET_OPTION. > > This breaks the offloading path via LTO since it introduces an > incompatibility in LTO format between host and offload machine. > > A very quick patch to fix it is below - the OpenACC testcase I was using > seems to be working again with this. Thoughts, suggestions?
I actually think this patch makes a lot of sense. Target option nodes by definition are target specific, generally there is no mapping between host and offloading target features. So, the host target options are not useful to the offloading target. And, because the amount of bits streamed is also target specific, say x86_64 will have different and incompatible cl_target_option_stream_{out,in} from nvptx, and even for Intel MIC offloading it doesn't make much sense, what CPU is certain function targetting doesn't necessarily have any relation to the Intel MIC that will offload it. I agree the strcmp (section_name_prefix, LTO_SECTION_NAME_PREFIX) == 0 checks in the patch aren't very nice, that could be replaced by some bool flag alongside of section_name_prefix that would be set where section_name_prefix is set: cgraphunit.c: section_name_prefix = OFFLOAD_SECTION_NAME_PREFIX; cgraphunit.c: section_name_prefix = LTO_SECTION_NAME_PREFIX; lto-streamer.c:const char *section_name_prefix = LTO_SECTION_NAME_PREFIX; lto/lto.c: section_name_prefix = OFFLOAD_SECTION_NAME_PREFIX; (call it say bool lto_stream_offload_p ?). Also note that the patch fixes all the current regressions in Intel MIC (emulated) offloading caused by the r218767 Jakub