[RFC PR43721] Optimize a/b and a%b to single divmod call

2015-10-30 Thread Prathamesh Kulkarni
? I added statistics_counter_event to keep track of number of calls inserted/used but not sure how to print them :/ I would be grateful for suggestions for improving the patch. Thank you, Prathamesh 2015-10-30 Prathamesh Kulkarni Kugan Vivekanandarajah * internal-fn.c (expand_DIVMOD): Ne

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-01 Thread Prathamesh Kulkarni
On 30 October 2015 at 15:57, Richard Biener wrote: > On Fri, Oct 30, 2015 at 8:39 AM, Prathamesh Kulkarni > wrote: >> Hi, >> I have attached revamped version of Kugan's patch >> (https://gcc.gnu.org/ml/gcc/2013-06/msg00100.html) for PR43721. >> Test-case: htt

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-02 Thread Prathamesh Kulkarni
On 2 November 2015 at 13:20, Prathamesh Kulkarni wrote: > On 30 October 2015 at 15:57, Richard Biener > wrote: >> On Fri, Oct 30, 2015 at 8:39 AM, Prathamesh Kulkarni >> wrote: >>> Hi, >>> I have attached revamped version of Kugan's patch >>>

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-03 Thread Prathamesh Kulkarni
On 2 November 2015 at 18:31, Richard Biener wrote: > On Mon, 2 Nov 2015, Prathamesh Kulkarni wrote: > >> On 2 November 2015 at 13:20, Prathamesh Kulkarni >> wrote: >> > On 30 October 2015 at 15:57, Richard Biener >> > wrote: >> >> On F

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-09 Thread Prathamesh Kulkarni
On 4 November 2015 at 20:35, Richard Biener wrote: > On Wed, 4 Nov 2015, Prathamesh Kulkarni wrote: > >> On 2 November 2015 at 18:31, Richard Biener wrote: >> > On Mon, 2 Nov 2015, Prathamesh Kulkarni wrote: >> > >> >> On 2 November 2015 at 13:20, Prath

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-11 Thread Prathamesh Kulkarni
On 10 November 2015 at 20:11, Richard Biener wrote: > On Mon, 9 Nov 2015, Prathamesh Kulkarni wrote: > >> On 4 November 2015 at 20:35, Richard Biener wrote: >> > >> > Btw, did you investigate code gen differences on x86_64/i586? That >> > target expa

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2015-11-11 Thread Prathamesh Kulkarni
On 11 November 2015 at 16:03, Richard Biener wrote: > On Wed, 11 Nov 2015, Prathamesh Kulkarni wrote: > >> On 10 November 2015 at 20:11, Richard Biener wrote: >> > On Mon, 9 Nov 2015, Prathamesh Kulkarni wrote: >> > >> >> On 4 November 2015 at 20:35,

help with PR69133

2016-01-17 Thread Prathamesh Kulkarni
Hi, I was having a look at PR69133. It appears that with -flto-partition=none, cgraph_node::get_untransformed_body () is called twice for node with asm_name _ZThn4_N11xercesc_3_11C5m_fn6ERKi. c++filt says it is: non-virtual thunk to xercesc_3_1::C::m_fn6(int const&) get_untransformed_body() calls

Re: help with PR69133

2016-01-18 Thread Prathamesh Kulkarni
On 17 January 2016 at 14:56, Prathamesh Kulkarni wrote: > Hi, > I was having a look at PR69133. > It appears that with -flto-partition=none, > cgraph_node::get_untransformed_body () > is called twice for node with asm_name _ZThn4_N11xercesc_3_11C5m_fn6ERKi. > c++filt says it is:

Re: Help! Regarding Bug 17896

2016-01-25 Thread Prathamesh Kulkarni
On 26 January 2016 at 00:45, Prasad Ghangal wrote: > Hi! > > I would like to solve "Bug 17896 - The expression (a>0 & b>0) should > give clearer warning message (-Wparentheses)" > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17896) but I am new to > gcc internals. > > Can someone please guide me

Re: [RFC PR43721] Optimize a/b and a%b to single divmod call

2016-01-27 Thread Prathamesh Kulkarni
On 11 November 2015 at 19:04, Richard Biener wrote: > On Wed, 11 Nov 2015, Prathamesh Kulkarni wrote: > >> On 11 November 2015 at 16:03, Richard Biener wrote: >> > On Wed, 11 Nov 2015, Prathamesh Kulkarni wrote: >> > >> >> On 10 November 2015 at 20:11

Re: Need suggestion about bug 68425

2016-02-21 Thread Prathamesh Kulkarni
On 21 February 2016 at 12:32, Prasad Ghangal wrote: > I was working on PR68425, > > my untested patch : > > > diff --git a/trunk/gcc/c/c-typeck.c b/trunk/gcc/c/c-typeck.c > --- a/trunk/gcc/c/c-typeck.c(revision 232768) > +++ b/trunk/gcc/c/c-typeck.c(working copy) > @@ -5856,7 +5856,7 @@ >

increase alignment of global structs in increase_alignment pass

2016-02-22 Thread Prathamesh Kulkarni
Hi Richard, As discussed in private mail, this version of patch attempts to increase alignment of global struct decl if it contains an an array field(s) and array's offset is a multiple of the alignment of vector type corresponding to it's scalar type and recursively checks for nested structs. eg:

Re: increase alignment of global structs in increase_alignment pass

2016-02-23 Thread Prathamesh Kulkarni
On 22 February 2016 at 17:36, Richard Biener wrote: > On Mon, 22 Feb 2016, Prathamesh Kulkarni wrote: > >> Hi Richard, >> As discussed in private mail, this version of patch attempts to >> increase alignment >> of global struct decl if it contains an an array field

Re: increase alignment of global structs in increase_alignment pass

2016-02-23 Thread Prathamesh Kulkarni
On 23 February 2016 at 17:31, Richard Biener wrote: > On Tue, 23 Feb 2016, Prathamesh Kulkarni wrote: > >> On 22 February 2016 at 17:36, Richard Biener wrote: >> > On Mon, 22 Feb 2016, Prathamesh Kulkarni wrote: >> > >> >> Hi Richard, >> >&g

Re: increase alignment of global structs in increase_alignment pass

2016-02-24 Thread Prathamesh Kulkarni
On 23 February 2016 at 22:11, Marek Polacek wrote: > On Tue, Feb 23, 2016 at 09:49:37PM +0530, Prathamesh Kulkarni wrote: > >> diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c >> index 2b25b45..a6af535 100644 >> --- a/gcc/tree-vectorizer.c >> +++ b/gcc/

Re: GCC GSOC 2016

2016-03-04 Thread Prathamesh Kulkarni
On 5 March 2016 at 01:28, Manuel López-Ibáñez wrote: > Tobias, Maxim, or anyone else, > > For the projects accepted in 2015, if you send me the relevant info > (project title, student name, mentor name, a link to some webpage, > blog, wiki or a mailing list post describing the project), I will tak

Re: [gimplefe] [gsoc16] Gimple Front End Project

2016-03-19 Thread Prathamesh Kulkarni
On 15 March 2016 at 20:46, Richard Biener wrote: > On Mon, Mar 14, 2016 at 7:27 PM, Michael Matz wrote: >> Hi, >> >> On Thu, 10 Mar 2016, Richard Biener wrote: >> >>> Then I'd like to be able to re-construct SSA without jumping through >>> hoops (usually you can get close but if you require copie

Re: [gimplefe] [gsoc16] Gimple Front End Project

2016-03-22 Thread Prathamesh Kulkarni
;> them with the explicit exception syntax probably isn't particularly >>> important. >>> >>>> *openmp functions like >>>> main._omp_fn.0 (void * .omp_data_i) >>> >>> I'd think you'd want to change the duping of th

Re: [gimplefe] [gsoc16] Gimple Front End Project

2016-03-24 Thread Prathamesh Kulkarni
>> basic stuff working" >> part to have all pieces of the project prototyped, including the pass manager >> support. Otherwise there is no way to fully test part of the implementation. >> I'd say modifying the gimple dumps can be done last as you can always writ

[ipa-comdat] put symbol in new comdat group if it's referenced from multiple comdat groups

2016-03-31 Thread Prathamesh Kulkarni
Hi, I was trying to address first TODO from ipa-comdats.c (attached patch) TODO: When symbol is used only by comdat symbols, but from different groups, it would make sense to produce a new comdat group for it with anonymous name. The patch introduces new lattice value ANON "between" COMDAT and BOT

How to check if two symbols are from same source unit during WPA ?

2016-04-12 Thread Prathamesh Kulkarni
Hi, How to check if two symbols are from same source file during WPA ? Is symbol1->lto_file_data == symbol2->lto_file_data true if symbol1 and symbol2 are from same source files ? Would that be a sufficient condition or do I need to check for something more ? Thanks, Prathamesh

Re: How to check if two symbols are from same source unit during WPA ?

2016-04-13 Thread Prathamesh Kulkarni
On 12 April 2016 at 22:41, Richard Biener wrote: > On April 12, 2016 3:47:19 PM GMT+02:00, Prathamesh Kulkarni > wrote: >>Hi, >>How to check if two symbols are from same source file during WPA ? >>Is symbol1->lto_file_data == symbol2->lto_file_data true if symbo

Re: How to check if two symbols are from same source unit during WPA ?

2016-04-14 Thread Prathamesh Kulkarni
On 14 April 2016 at 13:56, Richard Biener wrote: > On Thu, 14 Apr 2016, Prathamesh Kulkarni wrote: > >> On 12 April 2016 at 22:41, Richard Biener wrote: >> > On April 12, 2016 3:47:19 PM GMT+02:00, Prathamesh Kulkarni >> > wrote: >> >>Hi, >> &g

Re: increase alignment of global structs in increase_alignment pass

2016-05-04 Thread Prathamesh Kulkarni
On 23 February 2016 at 21:49, Prathamesh Kulkarni wrote: > On 23 February 2016 at 17:31, Richard Biener wrote: >> On Tue, 23 Feb 2016, Prathamesh Kulkarni wrote: >> >>> On 22 February 2016 at 17:36, Richard Biener wrote: >>> > On Mon, 22 Feb 2016, Pratha

Re: increase alignment of global structs in increase_alignment pass

2016-05-11 Thread Prathamesh Kulkarni
On 6 May 2016 at 17:20, Richard Biener wrote: > On Wed, 4 May 2016, Prathamesh Kulkarni wrote: > >> On 23 February 2016 at 21:49, Prathamesh Kulkarni >> wrote: >> > On 23 February 2016 at 17:31, Richard Biener wrote: >> >> On Tue, 23 Feb 2016, Pratha

Re: increase alignment of global structs in increase_alignment pass

2016-05-17 Thread Prathamesh Kulkarni
ping https://gcc.gnu.org/ml/gcc/2016-05/msg00120.html Thanks, Prathamesh On 11 May 2016 at 15:39, Prathamesh Kulkarni wrote: > On 6 May 2016 at 17:20, Richard Biener wrote: >> On Wed, 4 May 2016, Prathamesh Kulkarni wrote: >> >>> On 23 February 2016 at 21:49, Pratha

Re: increase alignment of global structs in increase_alignment pass

2016-05-18 Thread Prathamesh Kulkarni
On 17 May 2016 at 18:36, Richard Biener wrote: > On Wed, 11 May 2016, Prathamesh Kulkarni wrote: > >> On 6 May 2016 at 17:20, Richard Biener wrote: >> > >> > You can't simply use >> > >> > + offset = int_byte_position (field); >> &g

Re: increase alignment of global structs in increase_alignment pass

2016-05-18 Thread Prathamesh Kulkarni
On 18 May 2016 at 19:38, Richard Biener wrote: > On Wed, 18 May 2016, Prathamesh Kulkarni wrote: > >> On 17 May 2016 at 18:36, Richard Biener wrote: >> > On Wed, 11 May 2016, Prathamesh Kulkarni wrote: >> > >> >> On 6 May 2016 at 17:20, Richard Biener w

Re: increase alignment of global structs in increase_alignment pass

2016-05-20 Thread Prathamesh Kulkarni
On 19 May 2016 at 13:19, Richard Biener wrote: > On Thu, 19 May 2016, Prathamesh Kulkarni wrote: > >> On 18 May 2016 at 19:38, Richard Biener wrote: >> > On Wed, 18 May 2016, Prathamesh Kulkarni wrote: >> > >> >> On 17 May 2016 at 18:36, Richard

Re: [gimplefe] Parsing __GIMPLE function body

2016-06-01 Thread Prathamesh Kulkarni
On 30 May 2016 at 20:45, Prasad Ghangal wrote: > Hi, > > As David suggested in his rtlfe patch, > this patch recognizes __GIMPLE keyword and switches to > c_parser_parse_gimple_body by providing -fgimple option. > > > diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c > index 4568cf6..

Re: [gimplefe] Parsing __GIMPLE function body

2016-06-08 Thread Prathamesh Kulkarni
On 6 June 2016 at 15:49, Richard Biener wrote: > On Mon, Jun 6, 2016 at 11:27 AM, Prasad Ghangal > wrote: >> Hi, >> >> This patch parses simple assignment statement >> >> int a; >> void __GIMPLE foo() >> { >> a = 1; >> } >> >> but it does not produce gimple dump. In debugging I found that >> cf

Re: [gimplefe] hacking pass manager

2016-06-29 Thread Prathamesh Kulkarni
On 18 June 2016 at 12:02, Prasad Ghangal wrote: > Hi, > > I tried hacking pass manager to execute only given passes. For this I > am adding new member as opt_pass *custom_pass_list to the function > structure to store passes need to execute and providing the > custom_pass_list to execute_pass_list

Re: [gimplefe] hacking pass manager

2016-07-01 Thread Prathamesh Kulkarni
On 30 June 2016 at 17:10, Richard Biener wrote: > On Wed, Jun 29, 2016 at 9:13 PM, Prasad Ghangal > wrote: >> On 29 June 2016 at 22:15, Richard Biener wrote: >>> On June 29, 2016 6:20:29 PM GMT+02:00, Prathamesh Kulkarni >>> wrote: >>>>On 18 Jun

[RFC] lto partitioning of varpool_nodes for section anchors

2016-07-04 Thread Prathamesh Kulkarni
Hi, I have attached a "quick and dirty" prototype patch (var-partition-1.diff), that attempts to partition variables to reduce number of external references and to increase usage of section-anchors to CSE address computation of global variables. We could put a variable in a partition that has max

Re: [RFC] lto partitioning of varpool_nodes for section anchors

2016-07-06 Thread Prathamesh Kulkarni
On 4 July 2016 at 13:51, Andrew Pinski wrote: > On Mon, Jul 4, 2016 at 12:58 AM, Prathamesh Kulkarni > wrote: >> Hi, >> I have attached a "quick and dirty" prototype patch (var-partition-1.diff), >> that attempts to partition variables to reduce number of >

Re: [RFC] lto partitioning of varpool_nodes for section anchors

2016-07-06 Thread Prathamesh Kulkarni
On 6 July 2016 at 22:25, Andrew Pinski wrote: > On Wed, Jul 6, 2016 at 5:00 AM, Prathamesh Kulkarni > wrote: >> On 4 July 2016 at 13:51, Andrew Pinski wrote: >>> On Mon, Jul 4, 2016 at 12:58 AM, Prathamesh Kulkarni >>> wrote: >>>> Hi, >>>&g

Re: [gimplefe] hacking pass manager

2016-07-20 Thread Prathamesh Kulkarni
> > wrote: >>>>> > > > > > > On 6 July 2016 at 14:24, Richard Biener >>>>> > > wrote: >>>>> > > > > > > > On Wed, Jul 6, 2016 at 9:51 AM, Prasad Ghangal >>>>> > > wrote:

Re: Question about fold C_MAYBE_CONST_EXPR expressions

2016-07-24 Thread Prathamesh Kulkarni
On 24 July 2016 at 21:26, Bin.Cheng wrote: > Hi, > I ran into a problem that C frontend (in function > build_conditional_expr) creates expression like (C_MAYBE_CONST_EXPR > (NULL, x + const)). The inner expression (and its operands) have > unsigned int type. After that, the expression needs to b

possibly dead call from slsr_process_phi () to gimple_bb ()

2016-07-24 Thread Prathamesh Kulkarni
Hi, I am trying to write a WIP patch to warn for dead function calls, and incidentally it caught the following dead call to gimple_bb() from slsr_process_phi () in gimple-ssa-strength-reduction.c: if (SSA_NAME_IS_DEFAULT_DEF (arg)) arg_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)); else

Re: [gimplefe] hacking pass manager

2016-07-26 Thread Prathamesh Kulkarni
On 27 July 2016 at 00:20, Prasad Ghangal wrote: > On 20 July 2016 at 18:28, Richard Biener wrote: >> On Wed, Jul 20, 2016 at 1:46 PM, Prathamesh Kulkarni >> wrote: >>> On 20 July 2016 at 11:34, Richard Biener wrote: >>>> On Tue, Jul 19, 2016 at 10:09 PM, Pra

Re: [gimplefe] hacking pass manager

2016-07-28 Thread Prathamesh Kulkarni
On 29 July 2016 at 00:01, Prasad Ghangal wrote: > On 27 July 2016 at 14:22, Richard Biener wrote: >> On Tue, Jul 26, 2016 at 11:38 PM, Prathamesh Kulkarni >> wrote: >>> On 27 July 2016 at 00:20, Prasad Ghangal wrote: >>>> On 20 July 2016 at 18:28, Richard Bi

question about optab_libfunc() returning bogus libfuncs for sdivmod_optab

2016-08-22 Thread Prathamesh Kulkarni
Hi, While implementing divmod transform: https://gcc.gnu.org/ml/gcc-patches/2016-05/msg01757.html I ran into an issue with optab_libfunc(). It appears optab_libfunc (sdivmod_optab, DImode) returns a libfunc with name "__divmoddi4", even though such a libfunc does not exist in libgcc. This happens

[RFC] PR35503 - warn for restricted pointers

2016-08-26 Thread Prathamesh Kulkarni
Hi Richard, I was trying to have a look at PR35503. The attached patch tries to warn when an argument is passed to a restrict-qualified parameter and the argument could alias with other argument. For the following test-case: int f2(int *restrict x, int *y); void f(void) { int a; f2 (&a, &a);

cfg.c: redundant second assignment of bb_copy = NULL in free_original_copy_tables()

2016-09-02 Thread Prathamesh Kulkarni
Hi, There appears to be a redundant second assignmeent bb_copy = NULL in free_copy_original_tables(). I suppose it should be bb_original = NULL instead ? I found this mentioned on a blog "Bugs found in gcc with help of PVS studio": http://www.viva64.com/en/b/0425/#ID0EHCCK Thanks, Prathamesh diff

Re: cfg.c: redundant second assignment of bb_copy = NULL in free_original_copy_tables()

2016-09-02 Thread Prathamesh Kulkarni
On 2 September 2016 at 15:49, Richard Biener wrote: > On Fri, 2 Sep 2016, Prathamesh Kulkarni wrote: > >> Hi, >> There appears to be a redundant second assignmeent bb_copy = NULL in >> free_copy_original_tables(). I suppose it should be >> bb_original = NULL instead

Re: Additional BOFs for the GNU Cauldron?

2016-09-02 Thread Prathamesh Kulkarni
On 2 September 2016 at 14:49, Richard Biener wrote: > > There seems to be plenty of slots available on the 2nd track to > schedule additional BOFs. So I'd gather if there is interest > in discussing > > A) Unit testing (GIMPLE FE, RTL FE, the existing unit-testing), > basically how people fe

how to check if target supports andnot instruction ?

2016-10-12 Thread Prathamesh Kulkarni
Hi, I was having a look at PR71636 and added the following pattern to match.pd: x & ((1U << b) - 1) -> x & ~(~0U << b) However the transform is useful only if the target supports "andnot" instruction. As pointed out by Marc in PR for -march=core2, lhs generates worse code than rhs, so we shouldn't

Re: how to check if target supports andnot instruction ?

2016-10-12 Thread Prathamesh Kulkarni
On 12 October 2016 at 13:09, Prathamesh Kulkarni wrote: > Hi, > I was having a look at PR71636 and added the following pattern to match.pd: > x & ((1U << b) - 1) -> x & ~(~0U << b) > However the transform is useful only if the target supports "andnot"

Re: how to check if target supports andnot instruction ?

2016-10-13 Thread Prathamesh Kulkarni
On 12 October 2016 at 14:43, Richard Biener wrote: > On Wed, 12 Oct 2016, Marc Glisse wrote: > >> On Wed, 12 Oct 2016, Prathamesh Kulkarni wrote: >> >> > I was having a look at PR71636 and added the following pattern to match.pd: >> > x & ((1U <&l

bootstrap possibly broken on trunk ?

2016-10-13 Thread Prathamesh Kulkarni
Hi, I am getting the following error when bootstrapping trunk (tried with r241108) on x86_64-unknown-linux-gnu during stage-1: ../../../../gcc/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc:121:12: error: ISO C++ forbids declaration of \u2018_Bind_simple_helper\u2019 with no type [-fpermissi

Re: bootstrap possibly broken on trunk ?

2016-10-13 Thread Prathamesh Kulkarni
On 13 October 2016 at 23:12, Prathamesh Kulkarni wrote: > Hi, > I am getting the following error when bootstrapping trunk (tried with r241108) > on x86_64-unknown-linux-gnu during stage-1: > > ../../../../gcc/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc:121:12: > erro

Re: how to check if target supports andnot instruction ?

2016-10-15 Thread Prathamesh Kulkarni
On 13 October 2016 at 13:22, Marc Glisse wrote: > On Thu, 13 Oct 2016, Prathamesh Kulkarni wrote: > >> On 12 October 2016 at 14:43, Richard Biener wrote: >>> >>> On Wed, 12 Oct 2016, Marc Glisse wrote: >>> >>>> On Wed, 12 Oct 2016, Prathames

Re: how to check if target supports andnot instruction ?

2016-10-17 Thread Prathamesh Kulkarni
On 17 October 2016 at 13:52, Richard Biener wrote: > On Sat, 15 Oct 2016, Prathamesh Kulkarni wrote: > >> On 13 October 2016 at 13:22, Marc Glisse wrote: >> > On Thu, 13 Oct 2016, Prathamesh Kulkarni wrote: >> > >> >> On 12 October 2016 at 14:43, Richa

Re: History of GCC

2016-10-26 Thread Prathamesh Kulkarni
On 26 October 2016 at 11:23, Will Hawkins wrote: > Hello everyone! > > My name is Will Hawkins and I am a longtime user of gcc and admirer of > the project. I hope that this is the proper forum for the question I > am going to ask. If it isn't, please accept my apology and ignore me. > > I am a re

Re: strange test failures

2016-12-10 Thread Prathamesh Kulkarni
/opt/notnfs/msebor/src/gcc/gcc-78622/gcc/testsuite/gcc.c-torture/execute/execute.exp. > ERROR: unmatched open brace in list > > ERROR: tcl error sourcing > /opt/notnfs/msebor/src/gcc/gcc-78622/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp. > ERROR: torture-init: torture_without_loops

ICE's with -fgimple

2016-12-18 Thread Prathamesh Kulkarni
Hi, I observed a couple of similar ICE's with -fgimple for a function having startwith. eg: void __GIMPLE (startwith ("ccp1")) foo () { return; } Compiling with -fgimple -O works fine however removing -O causes the following ICE: foo.c:7:1: internal compiler error: in expand, at cgraphunit.c:2

[GSoC] Generating patterns from meta-description

2014-04-22 Thread Prathamesh Kulkarni
Hi, Thank-you for selecting me for GSoC 2014, I am looking forward to working with GCC community. I am grateful to Richard Biener and Diego Novillo for choosing to mentor me for this project. Unfortunately, I couldn't reply last week because I am in the middle of university exams, I apologize f

[GSoC] use obstack in parse_c_expr

2014-04-24 Thread Prathamesh Kulkarni
Hi, There was a comment in parse_c_expr, mentioning to use obstack to build c-code string. I have attached patch for the same. OK to commit ? * genmatch.c (parse_c_expr): Use obstack to build c code string. Thanks and Regards, Prathamesh Index: gcc/genmatch.c ==

[GSoC] TYPE stringfied in call to add_operator

2014-04-25 Thread Prathamesh Kulkarni
Hi, I have a daft question to ask. I was looking through genmatch, I couldn't figure out why is tree code class (TYPE) stringified in call to add_operator () ? #define DEFTREECODE (SYM, STRING, TYPE, NARGS) \ add_operator (SYM, #SYM, #TYPE, NARGS) In add_operator() tcc (argument correspo

Re: [GSoC] TYPE stringfied in call to add_operator

2014-04-25 Thread Prathamesh Kulkarni
On Fri, Apr 25, 2014 at 10:12 PM, Richard Biener wrote: > On April 25, 2014 4:54:28 PM CEST, Prathamesh Kulkarni > wrote: >>Hi, >>I have a daft question to ask. I was looking through genmatch, I >>couldn't figure out why is tree code class (TYPE) stringif

[GSoC] Few questions regarding genmatch

2014-05-07 Thread Prathamesh Kulkarni
Hi, I have few questions regarding genmatch: a) When simplification fails, we continue pattern matching with the next pattern in the order they appear in match.pd. Is that necessary ? Could we not simply return false from gimple_match_and_simplify if simplification fails ? b) How do we handle

[GSoC] writing test-case

2014-05-11 Thread Prathamesh Kulkarni
Hi, I was trying to write test-case for the pattern A + -B -> A - B (currently written for only int type). Is the test-case written correctly (attached) ? a) I am not able to follow why 3 slashes are required here in x_.\\\(D\\\) ? Why does x_.\(D\) not work ? (I saw 3 slashes used in a testca

Re: [GSoC] writing test-case

2014-05-11 Thread Prathamesh Kulkarni
On Sun, May 11, 2014 at 8:10 PM, Andreas Schwab wrote: > Prathamesh Kulkarni writes: > >> a) I am not able to follow why 3 slashes are required here >> in x_.\\\(D\\\) ? Why does x_.\(D\) not work ? > > Two of the three backslashes are eaten by the tcl parser.

Re: [GSoC] writing test-case

2014-05-13 Thread Prathamesh Kulkarni
On Tue, May 13, 2014 at 2:36 PM, Richard Biener wrote: > On Sun, May 11, 2014 at 5:00 PM, Prathamesh Kulkarni > wrote: >> On Sun, May 11, 2014 at 8:10 PM, Andreas Schwab >> wrote: >>> Prathamesh Kulkarni writes: >>> >>>> a) I am not able to f

Re: [GSoC] writing test-case

2014-05-14 Thread Prathamesh Kulkarni
On Wed, May 14, 2014 at 3:54 PM, Richard Biener wrote: > On Tue, May 13, 2014 at 11:06 PM, Prathamesh Kulkarni > wrote: >> On Tue, May 13, 2014 at 2:36 PM, Richard Biener >> wrote: >>> On Sun, May 11, 2014 at 5:00 PM, Prathamesh Kulkarni >>> wrote: >>&

Re: [GSoC] writing test-case

2014-05-14 Thread Prathamesh Kulkarni
On Wed, May 14, 2014 at 4:33 PM, Richard Biener wrote: > On Wed, May 14, 2014 at 12:30 PM, Richard Biener > wrote: >> On Wed, May 14, 2014 at 12:24 PM, Richard Biener >> wrote: >>> On Tue, May 13, 2014 at 11:06 PM, Prathamesh Kulkarni >>> wrote: >>&

Re: [GSoC] writing test-case

2014-05-14 Thread Prathamesh Kulkarni
On Wed, May 14, 2014 at 4:40 PM, Richard Biener wrote: > On Tue, May 13, 2014 at 11:06 PM, Prathamesh Kulkarni > wrote: >> On Tue, May 13, 2014 at 2:36 PM, Richard Biener >> wrote: >>> On Sun, May 11, 2014 at 5:00 PM, Prathamesh Kulkarni >>> wrote: >>&

Re: [GSoC] writing test-case

2014-05-14 Thread Prathamesh Kulkarni
On Thu, May 15, 2014 at 4:00 AM, Prathamesh Kulkarni wrote: > On Wed, May 14, 2014 at 3:54 PM, Richard Biener > wrote: >> On Tue, May 13, 2014 at 11:06 PM, Prathamesh Kulkarni >> wrote: >>> On Tue, May 13, 2014 at 2:36 PM, Richard Biener >>> wrote:

[GSoC] first phase

2014-05-19 Thread Prathamesh Kulkarni
Hi, Unfortunately I shall need to take this week off, due to university exams, which are up-to 27th May. I will start working from 28th on pattern matching with decision tree, and try to cover up for the first week. I am extremely sorry about this. I thought I would be able to do both during exa

Re: [GSoC] first phase

2014-05-20 Thread Prathamesh Kulkarni
On Tue, May 20, 2014 at 5:46 PM, Richard Biener wrote: > On Mon, May 19, 2014 at 7:30 PM, Prathamesh Kulkarni > wrote: >> Hi, >>Unfortunately I shall need to take this week off, due to university exams, >> which are up-to 27th May. I will start working from 28th on

[GSoC] decision tree first steps

2014-06-02 Thread Prathamesh Kulkarni
I have few questions regarding genmatch: a) Why is 4 hard-coded here: ? in write_nary_simplifiers: fprintf (f, " tree captures[4] = {};\n"); b) Should we add syntax for a symbol to denote multiple operators ? For exampleim in simplify_rotate: (X << CNT1) OP (X >> CNT2) with OP being +, |, ^

Re: [GSoC] decision tree first steps

2014-06-06 Thread Prathamesh Kulkarni
On Mon, Jun 2, 2014 at 6:14 PM, Richard Biener wrote: > On Mon, Jun 2, 2014 at 1:16 PM, Prathamesh Kulkarni > wrote: >> I have few questions regarding genmatch: >> >> a) Why is 4 hard-coded here: ? >> in write_nary_simplifiers: >> fprintf (f, " tre

Re: [GSoC] decision tree first steps

2014-06-11 Thread Prathamesh Kulkarni
On 6/11/14, Richard Biener wrote: > On Wed, Jun 11, 2014 at 12:53 PM, Richard Biener > wrote: >> On Wed, Jun 11, 2014 at 10:51 AM, Richard Biener >> wrote: >>> On Tue, Jun 10, 2014 at 1:57 PM, Richard Biener >>> wrote: >>>> On Tue, Jun 10,

Re: [GSoC] decision tree first steps

2014-06-11 Thread Prathamesh Kulkarni
On 6/11/14, Prathamesh Kulkarni wrote: > On 6/11/14, Richard Biener wrote: >> On Wed, Jun 11, 2014 at 12:53 PM, Richard Biener >> wrote: >>> On Wed, Jun 11, 2014 at 10:51 AM, Richard Biener >>> wrote: >>>> On Tue, Jun 10, 2014 at 1:57 PM, Richard B

Re: [GSoC] decision tree first steps

2014-06-13 Thread Prathamesh Kulkarni
On Thu, Jun 12, 2014 at 4:26 PM, Richard Biener wrote: > On Wed, Jun 11, 2014 at 4:09 PM, Prathamesh Kulkarni > wrote: >> On 6/11/14, Richard Biener wrote: >>> On Wed, Jun 11, 2014 at 12:53 PM, Richard Biener >>> wrote: >>>> On Wed, Jun 11, 20

Re: [GSoC] decision tree first steps

2014-06-18 Thread Prathamesh Kulkarni
On Tue, Jun 17, 2014 at 3:15 PM, Richard Biener wrote: > > On Tue, Jun 17, 2014 at 12:21 AM, Prathamesh Kulkarni > wrote: > > On Mon, Jun 16, 2014 at 4:45 PM, Richard Biener > > wrote: > >> > >> > * Patterns requiring GENERIC support like cond_expr >

[GSoC] commutative patterns

2014-06-19 Thread Prathamesh Kulkarni
Hi, The attached patch attempts to generate commutative variants for a given expression. Example: For the AST: (PLUS_EXPR (PLUS_EXPR @0 @1) @2), the commutative variants are: (PLUS_EXPR (PLUS_EXPR @0 @1 ) @2 ) (PLUS_EXPR (PLUS_EXPR @1 @0 ) @2 ) (PLUS_EXPR @2 (PLUS_EXPR @0 @1 ) ) (PLUS_EXPR @2

Re: [GSoC] commutative patterns

2014-06-19 Thread Prathamesh Kulkarni
On Fri, Jun 20, 2014 at 2:53 AM, Prathamesh Kulkarni wrote: > Hi, > The attached patch attempts to generate commutative variants for > a given expression. > > Example: > For the AST: (PLUS_EXPR (PLUS_EXPR @0 @1) @2), > > the commutative variants are: > (PLUS

Re: [GSoC] commutative patterns

2014-06-21 Thread Prathamesh Kulkarni
On Fri, Jun 20, 2014 at 3:02 AM, Prathamesh Kulkarni wrote: > > On Fri, Jun 20, 2014 at 2:53 AM, Prathamesh Kulkarni > wrote: > > Hi, > > The attached patch attempts to generate commutative variants for > > a given expression. > > > > Example: > >

Re: [GSoC] commutative patterns

2014-06-22 Thread Prathamesh Kulkarni
On Sun, Jun 22, 2014 at 3:09 AM, Prathamesh Kulkarni wrote: > On Fri, Jun 20, 2014 at 3:02 AM, Prathamesh Kulkarni > wrote: >> >> On Fri, Jun 20, 2014 at 2:53 AM, Prathamesh Kulkarni >> wrote: >> > Hi, >> > The attached patch attempts to gene

Re: [GSoC] decision tree first steps

2014-06-23 Thread Prathamesh Kulkarni
On Mon, Jun 23, 2014 at 5:58 PM, Richard Biener wrote: > On Mon, Jun 23, 2014 at 1:51 PM, Prathamesh Kulkarni > wrote: >> On Mon, Jun 23, 2014 at 3:38 PM, Richard Biener >> wrote: >>> On Mon, Jun 23, 2014 at 10:26 AM, Prathamesh Kulkarni >>> wrote:

[GSoC] symbol to denote multiple operators

2014-07-10 Thread Prathamesh Kulkarni
Hi, I have attempted to add syntax for symbol to denote multiple operators. I tried it with few bogus patterns and it appears to work hopefully -:) eg: (bogus pattern): (for op in plus minus (match_and_simplify (op @0 @1) (op @0 @0))) generates following patterns: (plus @0 @1) ->

Re: [GSoC] symbol to denote multiple operators

2014-07-13 Thread Prathamesh Kulkarni
On Fri, Jul 11, 2014 at 8:29 PM, Prathamesh Kulkarni wrote: > On 7/11/14, Richard Biener wrote: >> On Thu, Jul 10, 2014 at 8:05 PM, Prathamesh Kulkarni >> wrote: >>> Hi, >>>I have attempted to add syntax for symbol to denote multiple >>> operators.

predicates on expressions ?

2014-07-14 Thread Prathamesh Kulkarni
I was wondering if it was a good idea to implement predicate on expressions ? Sth like: (match_and_simplify (op (op2:predicate @0)) transform) instead of: (match_and_simplify (op (op2@1 @0)) if (predicate (@1)) transform) When predicate is simple as just being a macro/function, we coul

Re: predicates on expressions ?

2014-07-14 Thread Prathamesh Kulkarni
On Mon, Jul 14, 2014 at 6:35 PM, Richard Biener wrote: > On Mon, Jul 14, 2014 at 12:07 PM, Prathamesh Kulkarni > wrote: >> I was wondering if it was a good idea to implement >> predicate on expressions ? >> >> Sth like: >> (match_and_simplify >>

Re: predicates on expressions ?

2014-07-15 Thread Prathamesh Kulkarni
On Tue, Jul 15, 2014 at 2:07 PM, Richard Biener wrote: > On Mon, Jul 14, 2014 at 10:52 PM, Prathamesh Kulkarni > wrote: >> On Mon, Jul 14, 2014 at 6:35 PM, Richard Biener >> wrote: >>> On Mon, Jul 14, 2014 at 12:07 PM, Prathamesh Kulkarni >>> wrote: >&g

Re: predicates on expressions ?

2014-07-15 Thread Prathamesh Kulkarni
On Tue, Jul 15, 2014 at 6:05 PM, Richard Biener wrote: > On Mon, Jul 14, 2014 at 3:05 PM, Richard Biener > wrote: >> On Mon, Jul 14, 2014 at 12:07 PM, Prathamesh Kulkarni >> wrote: >>> I was wondering if it was a good idea to implement >>> predica

Re: predicates on expressions ?

2014-07-15 Thread Prathamesh Kulkarni
On Tue, Jul 15, 2014 at 6:28 PM, Richard Biener wrote: > On Tue, Jul 15, 2014 at 2:47 PM, Prathamesh Kulkarni > wrote: >> On Tue, Jul 15, 2014 at 2:07 PM, Richard Biener >> wrote: >>> On Mon, Jul 14, 2014 at 10:52 PM, Prathamesh Kulkarni >>> wrote: >>&

Re: predicates on expressions ?

2014-07-15 Thread Prathamesh Kulkarni
On Tue, Jul 15, 2014 at 6:29 PM, Prathamesh Kulkarni wrote: > On Tue, Jul 15, 2014 at 6:05 PM, Richard Biener > wrote: >> On Mon, Jul 14, 2014 at 3:05 PM, Richard Biener >> wrote: >>> On Mon, Jul 14, 2014 at 12:07 PM, Prathamesh Kulkarni >>> wrote: >>&

[GSoC] outer-if expressions

2014-07-26 Thread Prathamesh Kulkarni
Hi, This patch adds support for outer-if expressions. Couple of issues: a) Doesn't interop with for-pattern, since we don't replace identifier in c-expr yet, and this gets more complicated with addition of outer-if. b) I removed ifexpr-locations for now. I am not sure where to output if-expr l

[GSoC] support for literals

2014-07-27 Thread Prathamesh Kulkarni
Hi, I was wondering if it would be a good idea to have the following syntax for literals: (type val) ? type would be one of the tree-codes representing cst types like INTEGER_CST, REAL_CST, etc. eg: (negate (integer_cst 3)) would be equivalent to the following: (negate INTEGER_CST_P@0) if (TR

[GSoC] replacing op in c_expr

2014-07-28 Thread Prathamesh Kulkarni
I am having few issues replacing op in c_expr. I thought of following possibilities: a) create a new vec vector new_code. for each token in code { if token.type is not CPP_NAME new_code.safe_push (token); else { cpp_token new_token = ??? create new token of

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 4:41 PM, Richard Biener wrote: > On Wed, Jul 30, 2014 at 12:49 PM, Prathamesh Kulkarni > wrote: >> Hi, >>Sorry to ask a stupid question, but I am having issues writing patterns >> involving casts. I am trying to write patterns from simplify

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 4:49 PM, Richard Biener wrote: > On Wed, Jul 30, 2014 at 1:11 PM, Richard Biener > wrote: >> On Wed, Jul 30, 2014 at 12:49 PM, Prathamesh Kulkarni >> wrote: >>> Hi, >>>Sorry to ask a stupid question, but I am having issues writin

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 5:55 PM, Prathamesh Kulkarni wrote: > On Wed, Jul 30, 2014 at 4:41 PM, Richard Biener > wrote: >> On Wed, Jul 30, 2014 at 12:49 PM, Prathamesh Kulkarni >> wrote: >>> Hi, >>>Sorry to ask a stupid question, but I am having issues wri

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 6:44 PM, Richard Biener wrote: > On Wed, Jul 30, 2014 at 2:30 PM, Prathamesh Kulkarni > wrote: >> On Wed, Jul 30, 2014 at 5:55 PM, Prathamesh Kulkarni >> wrote: >>> On Wed, Jul 30, 2014 at 4:41 PM, Richard Biener >>> wrote: &

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 4:49 PM, Richard Biener wrote: > On Wed, Jul 30, 2014 at 1:11 PM, Richard Biener > wrote: >> On Wed, Jul 30, 2014 at 12:49 PM, Prathamesh Kulkarni >> wrote: >>> Hi, >>>Sorry to ask a stupid question, but I am having issues writin

Re: writing patterns

2014-07-30 Thread Prathamesh Kulkarni
On Wed, Jul 30, 2014 at 11:49 PM, Prathamesh Kulkarni wrote: > On Wed, Jul 30, 2014 at 4:49 PM, Richard Biener > wrote: >> On Wed, Jul 30, 2014 at 1:11 PM, Richard Biener >> wrote: >>> On Wed, Jul 30, 2014 at 12:49 PM, Prathamesh Kulkarni >>> wrote: &g

Re: writing patterns

2014-07-31 Thread Prathamesh Kulkarni
On Thu, Jul 31, 2014 at 2:15 PM, Richard Biener wrote: > On Thu, Jul 31, 2014 at 7:41 AM, Prathamesh Kulkarni > wrote: >> On Wed, Jul 30, 2014 at 11:49 PM, Prathamesh Kulkarni >> wrote: >>> On Wed, Jul 30, 2014 at 4:49 PM, Richard Biener >>> wrote: >>&

  1   2   3   >