guidance for GSoC 2016 under GCC

2016-01-03 Thread vivek pandya
Hello GCC developers,
I would like to work on one of the following idea in GSoC 2016 for GCC.

Function Reordering (Improvement) with LTO
Inter-procedural value range propagation pass
Implement tree level section anchors to improve code generation at ARM/PPC.

I have done some reading for first and second topic. I would like your guidance.
For first topic I have read Martin's master thesis and as far as I
understand currently he has implemented function reordering with PGO
support but this project would be using LTO support. Am I thinking it
right ?

For second project I have read the IPCP.c file in gcc source code
which implements Inter-procedural constant propagation with call
graphs and jump functions. According to Chapter 11, page 664 of
Optimizing Compilers for Modern Architectures: A Dependence-based
Approach book range propagation pass can be designed by extending
IPCP. Here extensions to IPCP would be deciding ranges of variable
from for loops, const assignment or if/else statement and modifying
jump functions so that ranges can be calculated base on operations.
Also we may use data structure for range as used in tree-vrp.c of gcc.

For third project I have not started studying about it. Please suggest
some readings.

Apart from this I have learned how to write simple passes and plugins
for gcc and its related data structures ( learned from Diego Novillo's
slide ). I have also written some simple optimization passes with LLVM
libs.

Please provide more information or experimental patches to study.

Sincerely,
Vivek Pandya

P.S : Actually I tried to contact Mr. Jan Hubicka as mentioned on idea
page but it seems that he is not reachable on his mail address
j...@suse.cz that is why I have mail to gcc dev list.


Re: ipa vrp implementation in gcc

2016-01-11 Thread vivek pandya
> On Mon, Jan 11, 2016 at 4:07 PM, Richard Biener 
> wrote:
>>
>> On Mon, Jan 11, 2016 at 1:38 AM, Kugan
>>  wrote:
>> > Hi All,
>> >
>> > I am looking at implementing a ipa vrp pass. Jan Hubicka also talks
>> > about this in 2013 GNU Cauldron as one of the optimization he would like
>> > to see in gcc. So my question is, is any one implementing it. If not we
>> > would like to do that.
>> >
>
> Hello I am Vivek Pandya, I am actually working on a GSoC 2016 proposal for
> his work and it is very similar to extending ipa-cp pass. I am also in touch
> with Jan Hubicka. These comments will certainly help me but if is urgent for
> any one you can begin work on this. Jan has shown interest to mentor me for
> this project but any help from community is always appreciated.
>
>>
>> > I also looked at the ipa-cp implementation to see how this can be done.
>> > Going by this, one of the way to implement this is (skipping all the
>> > details):
>> >
>> > - Have an early tree-vrp so that we can have value ranges for parameters
>> > at call sites.
>
> Actually a tree-vrp pass already exists. But as Jan has suggested me that
> ipa-vrp implementation should not be too much costly. So I am also thinking
> to include this work in my proposal and also using the analysis to improve
> LTO heuristics as the project duration will be around 2.5 months.
>>
>>
>> I'd rather use the IPA analysis phase for this and use a VRP algorithm
>> that doesn't require ASSERT_EXPR insertion.
>>
>> > - Create jump functions that captures the value ranges of call sites
>> > propagate the value ranges. In 2013 talk, Jan Hubicka talks about
>> >
>> > - Modifying ipa-prop.[h|c] to handles this but wouldn't it be easier to
>> > have its own and much more simpler implementation ?
>>
>> No idea.
>>
>> > - Once we have the value ranges for parameter/return values, we could
>> > rely on tree-vrp to use this and do the optimizations
>>
>> Yep.  IPA transform phase should annotate parameter default defs with
>> computed ranges.
>>
>> > Does this make any sense? Any thoughts/suggestions to work on this is
>> > highly appreciated.
>>
>> IPA alignment propagation should already be somewhat similar as in doing
>> an intersection step during propagation.
>>
>> Richard.
>>
>> > Thanks,
>> > Kugan
>
> Your comments certainly helps me to develop my proposal. Please let me know
> any updated to avoid the confusion and duplication of work.
> Sincerely,
> Vivek


Source Code for Profile Guided Code Positioning

2016-01-15 Thread vivek pandya
Hello GCC Developers,

Are 'Profile Guided Code Positioning' algorithms mentioned in
http://dl.acm.org/citation.cfm?id=93550 this paper ( Pettis and Hanse
) implemented in gcc ?
If yes kindly help me with code file location in gcc source tree.

Sincerely,
Vivek Pandya


Re: Source Code for Profile Guided Code Positioning

2016-01-15 Thread vivek pandya
Thanks Yury for
https://gcc.gnu.org/ml/gcc-patches/2011-09/msg01440.html this link.
It implements procedure reordering as linker plugin.
I have some questions :
1 ) Can you point me to some documentation for "how to write plugin
for linkers " I am I have not seen doc for structs with 'ld_' prefix
(i.e defined in plugin-api.h )
 2 ) There is one more algorithm for Basic Block ordering with
execution frequency count in PH paper . Is there any implementation
available for it ?

Sincerely,
Vivek


Re: ipa vrp implementation in gcc

2016-01-17 Thread vivek pandya
Vivek Pandya


On Mon, Jan 18, 2016 at 4:16 AM, Kugan
 wrote:
>
>
> > Hello I am Vivek Pandya, I am actually working on a GSoC 2016 proposal
> > for his work and it is very similar to extending ipa-cp pass. I am also
> > in touch with Jan Hubicka.
>
> Hi Vivek,
>
> Glad to know that you are planning to work on this. Could you please put
> you plan in an accessible place (or post it here) so that we know what
> you plans are. That way we can work on what you are not working. And
> also possible contribute to your plan in other ways (like testing and
> reviewing).
>
Hello Kugan,

Actually my work will include extending the ipa-cp pass to propagate
range information and then integrating this information to improve LTO
optimizations (at-least one). But as mentioned by Jan Hubicka the real
problem is not to extend ipa-cp pass but tree-vrp it self a big task
and scheduling it at early stage will cost a performance lose.
So actually I was looking at some alternatives to Patterson's approach
and particularly I found this non iterative method:
https://www.cs.berkeley.edu/~daw/papers/range-tacas04.pdf which has
already implemented in LLVM
.http://homepages.dcc.ufmg.br/~fernando/publications/papers/SBLP2011_douglas.pdf
So my plan for this is first implementing above mentioned approach
till 23 May , 2016 (My college project ) and then use this local pass
for Value range analysis and then in my GSoC 2016 project I will use
this pass for ipa-vrp pass and improving other ipa optimizations to
use this information.
Though in particular I have yet not figured implementation details.
Currently I am learning about gcc IRs.
If you have any further idea ( specially about constraints based
method ) please let me know and help building my implementation
approach.

Sincerely,
Vivek
>
> Thanks,
> Kugan


Re: ipa vrp implementation in gcc

2016-01-17 Thread vivek pandya
Vivek Pandya



On Mon, Jan 18, 2016 at 11:35 AM, vivek pandya  wrote:
> Vivek Pandya
>
>
> On Mon, Jan 18, 2016 at 4:16 AM, Kugan
>  wrote:
>>
>>
>> > Hello I am Vivek Pandya, I am actually working on a GSoC 2016 proposal
>> > for his work and it is very similar to extending ipa-cp pass. I am also
>> > in touch with Jan Hubicka.
>>
>> Hi Vivek,
>>
>> Glad to know that you are planning to work on this. Could you please put
>> you plan in an accessible place (or post it here) so that we know what
>> you plans are. That way we can work on what you are not working. And
>> also possible contribute to your plan in other ways (like testing and
>> reviewing).
>>
> Hello Kugan,
>
> Actually my work will include extending the ipa-cp pass to propagate
> range information and then integrating this information to improve LTO
> optimizations (at-least one). But as mentioned by Jan Hubicka the real
> problem is not to extend ipa-cp pass but tree-vrp it self a big task
> and scheduling it at early stage will cost a performance lose.
> So actually I was looking at some alternatives to Patterson's approach
> and particularly I found this non iterative method:
> https://www.cs.berkeley.edu/~daw/papers/range-tacas04.pdf which has
> already implemented in LLVM
> .http://homepages.dcc.ufmg.br/~fernando/publications/papers/SBLP2011_douglas.pdf

Also please some one suggest me wether this non iterative method will
be good to have as alternative VRP or not ? i.e will it serve our
purpose of light weight VRP to be used at earlier stage ??

> So my plan for this is first implementing above mentioned approach
> till 23 May , 2016 (My college project ) and then use this local pass
> for Value range analysis and then in my GSoC 2016 project I will use
> this pass for ipa-vrp pass and improving other ipa optimizations to
> use this information.
> Though in particular I have yet not figured implementation details.
> Currently I am learning about gcc IRs.
> If you have any further idea ( specially about constraints based
> method ) please let me know and help building my implementation
> approach.
>
> Sincerely,
> Vivek
>>
>> Thanks,
>> Kugan