public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool
@ 2018-04-24 14:45 Martin Jambor
  2018-04-25  6:04 ` Hrishikesh Kulkarni
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Jambor @ 2018-04-24 14:45 UTC (permalink / raw)
  To: GCC mailing list
  Cc: Hrishikesh Kulkarni, Martin Liska, Jan Hubicka, David Edelsohn

Hello,

I am pleased to announce that Hrishikesh Kulkarni will be working on
"Textual Representation of LTO Object Files (Textual LTO dump tool
project)" as his Google Summer of Code 2018 project.  I believe I write
on behalf of everybody in the GCC community when I congratulate him and
wish him success in the upcoming work.  Hrishikesh's mentors are Martin
Liška and Jan Hubička, but the plan is to have most of the conversation
about the project on the mailing list and so I would like to encourage
everyone to help him out here if they can.

According to the schedule of GSoC, we have entered "Community Bonding
period" which lasts until May 14th (when the first out of three "coding"
periods begin).  Hrishikesh, Martin and Honza will take over from me in
suggesting what technical things you should study/play with, but I'd
like to request that you make sure you get an FSF copyright assignment
quickly (see https://gcc.gnu.org/contribute.html#legal).  David, I
assume that Hrishikesh does not have the assignment yet, can you please
send him the necessary forms?  Hrishikesh, please fill them is when you
get and send them to FSF.  If at any moment it will appear that the
process got stuck, please let me know sooner rather than later.

On a general note, GCC was given two student slots which we requested
after receiving two high-quality student proposals.  Unfortunately,
Sebastiaan has withdrawn from GSoC 2018 before selection was announced
and so we "only" have one student this year.

I'm looking forward to the new tool,

Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool
  2018-04-24 14:45 GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool Martin Jambor
@ 2018-04-25  6:04 ` Hrishikesh Kulkarni
  2018-04-25  8:13   ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Hrishikesh Kulkarni @ 2018-04-25  6:04 UTC (permalink / raw)
  To: GCC mailing list; +Cc: Martin Jambor, Martin Liska, Jan Hubicka, David Edelsohn

Hi,

Thanks a lot for giving me this wonderful opportunity to work with GCC
under your guidance and mentorship (GSOC 2018).

Just a few starting queries

   1.

   As a starting point to read lto-object file, is it sufficient to only
   link with lto-object.c or shall I need other source files too ?
   2.

   Should the dump tool be under gcc or lto dir? Would I need to modify
   only gcc/Makefile.in to add entry for building the dump tool or any other
   Makefiles too ?


Also, I would proceed with copyright assignment as soon as I will receive
the mentioned forms.


Thanks,

Hrishikesh


On Tue, Apr 24, 2018 at 6:27 PM, Martin Jambor <mjambor@suse.cz> wrote:

> Hello,
>
> I am pleased to announce that Hrishikesh Kulkarni will be working on
> "Textual Representation of LTO Object Files (Textual LTO dump tool
> project)" as his Google Summer of Code 2018 project.  I believe I write
> on behalf of everybody in the GCC community when I congratulate him and
> wish him success in the upcoming work.  Hrishikesh's mentors are Martin
> Liška and Jan Hubička, but the plan is to have most of the conversation
> about the project on the mailing list and so I would like to encourage
> everyone to help him out here if they can.
>
> According to the schedule of GSoC, we have entered "Community Bonding
> period" which lasts until May 14th (when the first out of three "coding"
> periods begin).  Hrishikesh, Martin and Honza will take over from me in
> suggesting what technical things you should study/play with, but I'd
> like to request that you make sure you get an FSF copyright assignment
> quickly (see https://gcc.gnu.org/contribute.html#legal).  David, I
> assume that Hrishikesh does not have the assignment yet, can you please
> send him the necessary forms?  Hrishikesh, please fill them is when you
> get and send them to FSF.  If at any moment it will appear that the
> process got stuck, please let me know sooner rather than later.
>
> On a general note, GCC was given two student slots which we requested
> after receiving two high-quality student proposals.  Unfortunately,
> Sebastiaan has withdrawn from GSoC 2018 before selection was announced
> and so we "only" have one student this year.
>
> I'm looking forward to the new tool,
>
> Martin
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool
  2018-04-25  6:04 ` Hrishikesh Kulkarni
@ 2018-04-25  8:13   ` Richard Biener
  2018-04-28 18:22     ` Hrishikesh Kulkarni
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Biener @ 2018-04-25  8:13 UTC (permalink / raw)
  To: Hrishikesh Kulkarni
  Cc: GCC mailing list, Martin Jambor, Martin Liska, Jan Hubicka,
	David Edelsohn

On Wed, Apr 25, 2018 at 5:17 AM, Hrishikesh Kulkarni
<hrishikeshparag@gmail.com> wrote:
> Hi,
>
> Thanks a lot for giving me this wonderful opportunity to work with GCC
> under your guidance and mentorship (GSOC 2018).
>
> Just a few starting queries
>
>    1.
>
>    As a starting point to read lto-object file, is it sufficient to only
>    link with lto-object.c or shall I need other source files too ?

You will need a lot more source files - starting with libbackend.a is
probably easiest.  As said during the initial project discussion it
remains to be seen whether a fully standalone dump tool is
best or whether the actual work is to be done by lto1 and the dump
tool shall act merely as a driver around that and they communicate
via some special (set of) options to lto1.

IIRC we do not have any existing tool that builds trees or cgraph
nodes or reads gimple bodies, so picking pices that are required
is going to be "interesting" (and eventually will suggest some refactoring
to avoid pulling in unnecessary stuff).  You'll also run into issues expecting
some initialized global state.  So...

...for the first phase of experimenting with the code-base it's probably
easiest to add some testing option to gcc/lto/lang.opt and "do stuff"
within a if (flag_your_option) conditional from some point in
lto/lto.c:lto_main.

>    2.
>
>    Should the dump tool be under gcc or lto dir? Would I need to modify
>    only gcc/Makefile.in to add entry for building the dump tool or any other
>    Makefiles too ?

I'd say it most naturally would reside in gcc/lto/ and thus its Make-lang.in
would need to be adjusted.

>
> Also, I would proceed with copyright assignment as soon as I will receive
> the mentioned forms.
>
>
> Thanks,
>
> Hrishikesh
>
>
> On Tue, Apr 24, 2018 at 6:27 PM, Martin Jambor <mjambor@suse.cz> wrote:
>
>> Hello,
>>
>> I am pleased to announce that Hrishikesh Kulkarni will be working on
>> "Textual Representation of LTO Object Files (Textual LTO dump tool
>> project)" as his Google Summer of Code 2018 project.  I believe I write
>> on behalf of everybody in the GCC community when I congratulate him and
>> wish him success in the upcoming work.  Hrishikesh's mentors are Martin
>> Liška and Jan Hubička, but the plan is to have most of the conversation
>> about the project on the mailing list and so I would like to encourage
>> everyone to help him out here if they can.
>>
>> According to the schedule of GSoC, we have entered "Community Bonding
>> period" which lasts until May 14th (when the first out of three "coding"
>> periods begin).  Hrishikesh, Martin and Honza will take over from me in
>> suggesting what technical things you should study/play with, but I'd
>> like to request that you make sure you get an FSF copyright assignment
>> quickly (see https://gcc.gnu.org/contribute.html#legal).  David, I
>> assume that Hrishikesh does not have the assignment yet, can you please
>> send him the necessary forms?  Hrishikesh, please fill them is when you
>> get and send them to FSF.  If at any moment it will appear that the
>> process got stuck, please let me know sooner rather than later.
>>
>> On a general note, GCC was given two student slots which we requested
>> after receiving two high-quality student proposals.  Unfortunately,
>> Sebastiaan has withdrawn from GSoC 2018 before selection was announced
>> and so we "only" have one student this year.
>>
>> I'm looking forward to the new tool,
>>
>> Martin
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool
  2018-04-25  8:13   ` Richard Biener
@ 2018-04-28 18:22     ` Hrishikesh Kulkarni
  2018-04-30 11:56       ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Hrishikesh Kulkarni @ 2018-04-28 18:22 UTC (permalink / raw)
  To: GCC mailing list
  Cc: Martin Liska, Jan Hubicka, Richard Biener, Martin Jambor, David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 4279 bytes --]

Hi,

I have created a new file lto-dump.c and to test if it's linked
correctly, I have put a dummy function called dump which should simply
print hello world after passing -dump option to lto1.

~/gnu-toolchain/gcc/master/tests$ ../stage1-build/gcc/lto1 hello.o -fdump

Now while adding -fdump option in lang.opt for command line option I
am getting error “unrecognised  command line option '-fdump' ”.
So how should I proceed with adding this new option.
Please find the diff file attached.


Thanks,

Hrishikesh

On Wed, Apr 25, 2018 at 1:35 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Wed, Apr 25, 2018 at 5:17 AM, Hrishikesh Kulkarni
> <hrishikeshparag@gmail.com> wrote:
>> Hi,
>>
>> Thanks a lot for giving me this wonderful opportunity to work with GCC
>> under your guidance and mentorship (GSOC 2018).
>>
>> Just a few starting queries
>>
>>    1.
>>
>>    As a starting point to read lto-object file, is it sufficient to only
>>    link with lto-object.c or shall I need other source files too ?
>
> You will need a lot more source files - starting with libbackend.a is
> probably easiest.  As said during the initial project discussion it
> remains to be seen whether a fully standalone dump tool is
> best or whether the actual work is to be done by lto1 and the dump
> tool shall act merely as a driver around that and they communicate
> via some special (set of) options to lto1.
>
> IIRC we do not have any existing tool that builds trees or cgraph
> nodes or reads gimple bodies, so picking pices that are required
> is going to be "interesting" (and eventually will suggest some refactoring
> to avoid pulling in unnecessary stuff).  You'll also run into issues expecting
> some initialized global state.  So...
>
> ...for the first phase of experimenting with the code-base it's probably
> easiest to add some testing option to gcc/lto/lang.opt and "do stuff"
> within a if (flag_your_option) conditional from some point in
> lto/lto.c:lto_main.
>
>>    2.
>>
>>    Should the dump tool be under gcc or lto dir? Would I need to modify
>>    only gcc/Makefile.in to add entry for building the dump tool or any other
>>    Makefiles too ?
>
> I'd say it most naturally would reside in gcc/lto/ and thus its Make-lang.in
> would need to be adjusted.
>
>>
>> Also, I would proceed with copyright assignment as soon as I will receive
>> the mentioned forms.
>>
>>
>> Thanks,
>>
>> Hrishikesh
>>
>>
>> On Tue, Apr 24, 2018 at 6:27 PM, Martin Jambor <mjambor@suse.cz> wrote:
>>
>>> Hello,
>>>
>>> I am pleased to announce that Hrishikesh Kulkarni will be working on
>>> "Textual Representation of LTO Object Files (Textual LTO dump tool
>>> project)" as his Google Summer of Code 2018 project.  I believe I write
>>> on behalf of everybody in the GCC community when I congratulate him and
>>> wish him success in the upcoming work.  Hrishikesh's mentors are Martin
>>> Liška and Jan Hubička, but the plan is to have most of the conversation
>>> about the project on the mailing list and so I would like to encourage
>>> everyone to help him out here if they can.
>>>
>>> According to the schedule of GSoC, we have entered "Community Bonding
>>> period" which lasts until May 14th (when the first out of three "coding"
>>> periods begin).  Hrishikesh, Martin and Honza will take over from me in
>>> suggesting what technical things you should study/play with, but I'd
>>> like to request that you make sure you get an FSF copyright assignment
>>> quickly (see https://gcc.gnu.org/contribute.html#legal).  David, I
>>> assume that Hrishikesh does not have the assignment yet, can you please
>>> send him the necessary forms?  Hrishikesh, please fill them is when you
>>> get and send them to FSF.  If at any moment it will appear that the
>>> process got stuck, please let me know sooner rather than later.
>>>
>>> On a general note, GCC was given two student slots which we requested
>>> after receiving two high-quality student proposals.  Unfortunately,
>>> Sebastiaan has withdrawn from GSoC 2018 before selection was announced
>>> and so we "only" have one student this year.
>>>
>>> I'm looking forward to the new tool,
>>>
>>> Martin
>>>

[-- Attachment #2: foo.diff --]
[-- Type: text/x-patch, Size: 2860 bytes --]

diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
index 4695077..465662e 100644
--- a/gcc/lto/Make-lang.in
+++ b/gcc/lto/Make-lang.in
@@ -22,7 +22,7 @@
 # The name of the LTO compiler.
 LTO_EXE = lto1$(exeext)
 # The LTO-specific object files inclued in $(LTO_EXE).
-LTO_OBJS = lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o
+LTO_OBJS = lto/lto-lang.o lto/lto.o lto/lto-object.o attribs.o lto/lto-partition.o lto/lto-symtab.o lto/lto-dump.o
 lto_OBJS = $(LTO_OBJS)
 
 # this is only useful in a LTO bootstrap, but this does not work right
diff --git a/gcc/lto/lang.opt b/gcc/lto/lang.opt
index 0a408d3..684fdb9 100644
--- a/gcc/lto/lang.opt
+++ b/gcc/lto/lang.opt
@@ -42,6 +42,7 @@ Enum(lto_linker_output) String(pie) Value(LTO_LINKER_OUTPUT_PIE)
 EnumValue
 Enum(lto_linker_output) String(exec) Value(LTO_LINKER_OUTPUT_EXEC)
 
+
 flinker-output=
 LTO Report Driver Joined RejectNegative Enum(lto_linker_output) Var(flag_lto_linker_output) Init(LTO_LINKER_OUTPUT_UNKNOWN)
 Set linker output type (used internally during LTO optimization)
@@ -63,6 +64,10 @@ fwpa=
 LTO Driver RejectNegative Joined Var(flag_wpa)
 Whole program analysis (WPA) mode with number of parallel jobs specified.
 
+fdump
+LTO Dump Tool
+Call the dump function.
+
 fresolution=
 LTO Joined
 The resolution file.
diff --git a/gcc/lto/lto-dump.c b/gcc/lto/lto-dump.c
new file mode 100644
index 0000000..f7ed8b9
--- /dev/null
+++ b/gcc/lto/lto-dump.c
@@ -0,0 +1,42 @@
+/* LTO dump tool
+   Copyright (C) 2009-2018 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "target.h"
+#include "function.h"
+#include "basic-block.h"
+#include "tree.h"
+#include "gimple.h"
+#include "cgraph.h"
+#include "lto-streamer.h"
+#include "ipa-utils.h"
+#include "builtins.h"
+#include "alias.h"
+#include "lto-symtab.h"
+#include "stringpool.h"
+#include "attribs.h"
+#include "stdio.h"
+
+void dump()
+{
+
+	printf("Hello World!\n");
+}
\ No newline at end of file
diff --git a/gcc/lto/lto-dump.h b/gcc/lto/lto-dump.h
new file mode 100644
index 0000000..676ba5b
--- /dev/null
+++ b/gcc/lto/lto-dump.h
@@ -0,0 +1 @@
+void dump();
\ No newline at end of file

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool
  2018-04-28 18:22     ` Hrishikesh Kulkarni
@ 2018-04-30 11:56       ` Richard Biener
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2018-04-30 11:56 UTC (permalink / raw)
  To: Hrishikesh Kulkarni
  Cc: GCC mailing list, Martin Liska, Jan Hubicka, Martin Jambor,
	David Edelsohn

On Sat, Apr 28, 2018 at 5:36 PM, Hrishikesh Kulkarni
<hrishikeshparag@gmail.com> wrote:
> Hi,
>
> I have created a new file lto-dump.c and to test if it's linked
> correctly, I have put a dummy function called dump which should simply
> print hello world after passing -dump option to lto1.
>
> ~/gnu-toolchain/gcc/master/tests$ ../stage1-build/gcc/lto1 hello.o -fdump
>
> Now while adding -fdump option in lang.opt for command line option I
> am getting error “unrecognised  command line option '-fdump' ”.
> So how should I proceed with adding this new option.
> Please find the diff file attached.

+fdump
+LTO Dump Tool
+Call the dump function.
+


try

fdump
LTO
Call the dump function.

instead.  The second line is magic flags that need to be recognized.
You probably want instead

LTO Var(flag_lto_dump)

so you can test whether the flag is set or not as well.

Sorry for the late response.

Richard.

>
> Thanks,
>
> Hrishikesh
>
> On Wed, Apr 25, 2018 at 1:35 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Wed, Apr 25, 2018 at 5:17 AM, Hrishikesh Kulkarni
>> <hrishikeshparag@gmail.com> wrote:
>>> Hi,
>>>
>>> Thanks a lot for giving me this wonderful opportunity to work with GCC
>>> under your guidance and mentorship (GSOC 2018).
>>>
>>> Just a few starting queries
>>>
>>>    1.
>>>
>>>    As a starting point to read lto-object file, is it sufficient to only
>>>    link with lto-object.c or shall I need other source files too ?
>>
>> You will need a lot more source files - starting with libbackend.a is
>> probably easiest.  As said during the initial project discussion it
>> remains to be seen whether a fully standalone dump tool is
>> best or whether the actual work is to be done by lto1 and the dump
>> tool shall act merely as a driver around that and they communicate
>> via some special (set of) options to lto1.
>>
>> IIRC we do not have any existing tool that builds trees or cgraph
>> nodes or reads gimple bodies, so picking pices that are required
>> is going to be "interesting" (and eventually will suggest some refactoring
>> to avoid pulling in unnecessary stuff).  You'll also run into issues expecting
>> some initialized global state.  So...
>>
>> ...for the first phase of experimenting with the code-base it's probably
>> easiest to add some testing option to gcc/lto/lang.opt and "do stuff"
>> within a if (flag_your_option) conditional from some point in
>> lto/lto.c:lto_main.
>>
>>>    2.
>>>
>>>    Should the dump tool be under gcc or lto dir? Would I need to modify
>>>    only gcc/Makefile.in to add entry for building the dump tool or any other
>>>    Makefiles too ?
>>
>> I'd say it most naturally would reside in gcc/lto/ and thus its Make-lang.in
>> would need to be adjusted.
>>
>>>
>>> Also, I would proceed with copyright assignment as soon as I will receive
>>> the mentioned forms.
>>>
>>>
>>> Thanks,
>>>
>>> Hrishikesh
>>>
>>>
>>> On Tue, Apr 24, 2018 at 6:27 PM, Martin Jambor <mjambor@suse.cz> wrote:
>>>
>>>> Hello,
>>>>
>>>> I am pleased to announce that Hrishikesh Kulkarni will be working on
>>>> "Textual Representation of LTO Object Files (Textual LTO dump tool
>>>> project)" as his Google Summer of Code 2018 project.  I believe I write
>>>> on behalf of everybody in the GCC community when I congratulate him and
>>>> wish him success in the upcoming work.  Hrishikesh's mentors are Martin
>>>> Liška and Jan Hubička, but the plan is to have most of the conversation
>>>> about the project on the mailing list and so I would like to encourage
>>>> everyone to help him out here if they can.
>>>>
>>>> According to the schedule of GSoC, we have entered "Community Bonding
>>>> period" which lasts until May 14th (when the first out of three "coding"
>>>> periods begin).  Hrishikesh, Martin and Honza will take over from me in
>>>> suggesting what technical things you should study/play with, but I'd
>>>> like to request that you make sure you get an FSF copyright assignment
>>>> quickly (see https://gcc.gnu.org/contribute.html#legal).  David, I
>>>> assume that Hrishikesh does not have the assignment yet, can you please
>>>> send him the necessary forms?  Hrishikesh, please fill them is when you
>>>> get and send them to FSF.  If at any moment it will appear that the
>>>> process got stuck, please let me know sooner rather than later.
>>>>
>>>> On a general note, GCC was given two student slots which we requested
>>>> after receiving two high-quality student proposals.  Unfortunately,
>>>> Sebastiaan has withdrawn from GSoC 2018 before selection was announced
>>>> and so we "only" have one student this year.
>>>>
>>>> I'm looking forward to the new tool,
>>>>
>>>> Martin
>>>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-30 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 14:45 GSoC 2018: Hrishikesh Kulkarni has been selected to work on LTO dumping tool Martin Jambor
2018-04-25  6:04 ` Hrishikesh Kulkarni
2018-04-25  8:13   ` Richard Biener
2018-04-28 18:22     ` Hrishikesh Kulkarni
2018-04-30 11:56       ` Richard Biener

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).