From: "Michael V. Zolotukhin" <michael.v.zolotukhin@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>,
Thomas Schwinge <thomas@codesourcery.com>,
Bernd Schmidt <bernds@codesourcery.com>,
Richard Biener <rguenther@suse.de>,
Kirill Yukhin <kirill.yukhin@gmail.com>,
Ilya Verbin <iverbin@gmail.com>,
Andrey Turetskiy <andrey.turetskiy@gmail.com>,
Ilya Tocar <tocarip.intel@gmail.com>,
gcc <gcc-patches@gcc.gnu.org>
Subject: [RFC][gomp4] Offloading patches (1/3): Add '-fopenmp_target' option
Date: Tue, 17 Dec 2013 11:35:00 -0000 [thread overview]
Message-ID: <20131217113522.GA23078@msticlxl57.ims.intel.com> (raw)
Hi everybody,
Here is a set of patches implementing one more piece of offloading support in
GCC. These three patches allow to build a host binary with target image and all
tables embedded. Along with patches for libgomp and libgomp plugin, which
hopefully will be sent soon, that gives a functional and runnable executable (or
DSO) with actual offloading to MIC.
There is still a lot to do in this area, but this is the necessary basics - with
this we could actually run offloaded code, produced fully by compiler.
We would like to hear any feedback on these patches: what issues we should
address first before commit (if any), how the patches fit OpenACC work, etc.
Here is a patch 1/3: Add '-fopenmp_target' option This option tells lto1 to look
for "*.target_lto*" sections instead of usual "*.lto*". That option is passed
to target compiler when we invoke it to build target image.
Thanks,
Michael
---
gcc/lto/lang.opt | 4 ++++
gcc/lto/lto-object.c | 5 +++--
gcc/lto/lto.c | 7 ++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gcc/lto/lang.opt b/gcc/lto/lang.opt
index 7a9aede..cd0098c 100644
--- a/gcc/lto/lang.opt
+++ b/gcc/lto/lang.opt
@@ -40,4 +40,8 @@ fresolution=
LTO Joined
The resolution file
+fopenmp_target
+LTO Var(flag_openmp_target)
+Run LTO infrastructure to read target-side bytecode and to build it.
+
; This comment is to ensure we retain the blank line above.
diff --git a/gcc/lto/lto-object.c b/gcc/lto/lto-object.c
index 19f10cc..64274f3 100644
--- a/gcc/lto/lto-object.c
+++ b/gcc/lto/lto-object.c
@@ -59,6 +59,8 @@ struct lto_simple_object
static simple_object_attributes *saved_attributes;
+extern const char *section_name_prefix;
+
/* Initialize FILE, an LTO file object for FILENAME. */
static void
@@ -229,8 +231,7 @@ lto_obj_add_section (void *data, const char *name, off_t offset,
void **slot;
struct lto_section_list *list = loasd->list;
- if (strncmp (name, LTO_SECTION_NAME_PREFIX,
- strlen (LTO_SECTION_NAME_PREFIX)) != 0)
+ if (strncmp (name, section_name_prefix, strlen (section_name_prefix)))
return 1;
new_name = xstrdup (name);
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 0211437..dedf8a8 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -49,6 +49,8 @@ along with GCC; see the file COPYING3. If not see
#include "context.h"
#include "pass_manager.h"
+extern const char *section_name_prefix;
+
/* Vector to keep track of external variables we've seen so far. */
vec<tree, va_gc> *lto_global_var_decls;
@@ -2081,7 +2083,7 @@ lto_section_with_id (const char *name, unsigned HOST_WIDE_INT *id)
{
const char *s;
- if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX)))
+ if (strncmp (name, section_name_prefix, strlen (section_name_prefix)))
return 0;
s = strrchr (name, '.');
return s && sscanf (s, "." HOST_WIDE_INT_PRINT_HEX_PURE, id) == 1;
@@ -2757,6 +2759,9 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
timevar_push (TV_IPA_LTO_DECL_IN);
+ if (flag_openmp_target)
+ section_name_prefix = OMP_SECTION_NAME_PREFIX;
+
real_file_decl_data
= decl_data = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (nfiles + 1);
real_file_count = nfiles;
--
1.7.1
next reply other threads:[~2013-12-17 11:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 11:35 Michael V. Zolotukhin [this message]
2014-01-16 11:36 ` Michael Zolotukhin
2014-01-21 14:40 ` Bernd Schmidt
2014-01-22 10:54 ` Andrey Turetskiy
2014-01-27 13:13 ` Bernd Schmidt
2014-01-28 13:47 ` Ilya Verbin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131217113522.GA23078@msticlxl57.ims.intel.com \
--to=michael.v.zolotukhin@gmail.com \
--cc=andrey.turetskiy@gmail.com \
--cc=bernds@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=iverbin@gmail.com \
--cc=jakub@redhat.com \
--cc=kirill.yukhin@gmail.com \
--cc=rguenther@suse.de \
--cc=thomas@codesourcery.com \
--cc=tocarip.intel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).