Re: Identifying a pointer to a structure

2015-12-08 Thread Uday P. Khedker
Richard Biener wrote on 12/03/2015 03:32 PM: On Thu, Dec 3, 2015 at 8:54 AM, Uday P. Khedker wrote: We are implementing points-to analysis in GCC 4.7.2 and need to distinguish between pointers to scalars and the pointers to structures. This distinction by using the TYPE (TREE_TYPE) hierarchy

Identifying a pointer to a structure

2015-12-02 Thread Uday P. Khedker
We are implementing points-to analysis in GCC 4.7.2 and need to distinguish between pointers to scalars and the pointers to structures. This distinction by using the TYPE (TREE_TYPE) hierarchy of the tree node of the pointer. We have two questions: (a) Is it sufficient to check for the presence

Re: Compilation of object creation in C++

2015-08-21 Thread Uday P. Khedker
On 08/19/2015 04:44 PM, Andrew Pinski wrote: On Wed, Aug 19, 2015 at 7:16 PM, Uday P. Khedker wrote: Why is this different? Why is __comp_ctor not invoked in each case? This looks like the function has been inlined as it is short. Thanks, this is a useful lead. Setting -fno-inline

Re: Compilation of object creation in C++

2015-08-19 Thread Uday P. Khedker
Andrew Pinski wrote on Wednesday 19 August 2015 04:44 PM: On Wed, Aug 19, 2015 at 7:16 PM, Uday P. Khedker wrote: We are working on an analysis for identifying the class of an object flow sensitively for flow sensitive de-virtualization (i.e. replacing a virtual function call by a call to

Compilation of object creation in C++

2015-08-19 Thread Uday P. Khedker
We are working on an analysis for identifying the class of an object flow sensitively for flow sensitive de-virtualization (i.e. replacing a virtual function call by a call to the function of a known class in the hierarchy). This is a regular ipa pass. It find outs the class of an object at po

Re: Preserving tree node fields for access in LTO?

2015-07-28 Thread Uday P. Khedker
Richard Biener wrote on Tuesday 28 July 2015 01:12 PM: On Mon, Jul 27, 2015 at 7:14 PM, Uday Khedker wrote: We have added a new field (bool ptr_arith in struct tree_base) to the tree node. We are assigning values to this field in a gimple pass in non-LTO mode and would like to access them in

Re: Typecasting information in MEM[...] GIMPLE

2015-07-27 Thread Uday P. Khedker
Jakub Jelinek wrote on Monday 27 July 2015 03:50 PM: On Mon, Jul 27, 2015 at 03:35:45PM +0530, Uday Khedker wrote: We are interested in extracting the type of a tree node that appears within MEM_REF. Given a C program: struct node * * pvar; struct node qvar; pvar = (struct nod

Re: GIMPLE pass - Assignment evaluation

2013-12-16 Thread Uday P. Khedker
You may also want to go through the slides at http://www.cse.iitb.ac.in/grc/gcc-workshop-13/index.php?page=slides. In particular, http://www.cse.iitb.ac.in/grc/gcc-workshop-13/downloads/slides/Day1/gccw13-gimple-manipulation.pdf and http://www.cse.iitb.ac.in/grc/gcc-workshop-13/downloads/slid

Re: gcc : c++11 : full support : eta?

2013-02-18 Thread Uday P. Khedker
Gerald Pfeifer wrote, On Monday 18 February 2013 02:17 AM: On Thu, 24 Jan 2013, Richard Biener wrote: There are technical details of the maintaining part - like would the material reside in SVN? Or in the CVS where we keep our webpages? Or somewhere else public (github?)? Would we want to ha

Re: gcc : c++11 : full support : eta?

2013-01-25 Thread Uday P. Khedker
Paolo Bonzini wrote, On Friday 25 January 2013 05:38 PM: Il 25/01/2013 08:24, Uday P. Khedker ha scritto: Exactly. We have been using our training program since 2007 (and have been incrementally refining it on a continuously). Our experience has been that it has brought down the ramp up

Re: gcc : c++11 : full support : eta?

2013-01-24 Thread Uday P. Khedker
Toon Moene wrote, On Friday 25 January 2013 02:31 AM: On 01/23/2013 08:43 PM, Richard Biener wrote: Ah, well - the old issue that LLVM has just become a very good marketing machinery (and we've stayed at being a compiler - heh). The problem of being on a compiler-only list is that this is b

Re: Long term viability of GCC (was Re: gcc : c++11 : full support : eta?)

2013-01-24 Thread Uday P. Khedker
David Malcolm wrote, On Friday 25 January 2013 12:15 AM: [oh, and Uday: am very much enjoying reading your Data Flow Analysis book - thanks for writing it! ] Thanks David! I am already working on the second version because now I know very many improvements that I would like to make. Sh

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2013-01-24 Thread Uday P. Khedker
Richard Biener wrote, On Thursday 24 January 2013 05:28 PM: In the program below, we have a global pointer p that has conditional assignments before its use on the RHS of a copy statement. - #include int *

Re: gcc : c++11 : full support : eta?

2013-01-24 Thread Uday P. Khedker
Richard Biener wrote, On Thursday 24 January 2013 05:38 PM: Anything I would consider "official courseware" would have to be contributed to and maintained by the community (of which you can play the main part of course). Now I don't know whether it is wise to try to ask the FSF if it wants to

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2013-01-24 Thread Uday P. Khedker
Richard Biener wrote, On Thursday 24 January 2013 01:57 AM: On Wed, Jan 23, 2013 at 8:12 PM, Uday Khedker wrote: Hi Richard, I am trying to understand the full implications of your statement: Yes, that's what I say. Any pointer that is dereferenced is first copied to an SSA name. Basica

Re: Building GCC using C++

2013-01-14 Thread Uday P. Khedker
Basile Starynkevitch wrote, On Tuesday 15 January 2013 11:34 AM: On Tue, Jan 15, 2013 at 11:16:54AM +0530, Uday P. Khedker wrote: I was trying to understand the exact meaning of a loose statement floating around ("gcc has moved to C++ from version 4.7 onwards). I reckon from

Building GCC using C++

2013-01-14 Thread Uday P. Khedker
I was trying to understand the exact meaning of a loose statement floating around ("gcc has moved to C++ from version 4.7 onwards). I reckon from http://gcc.gnu.org/wiki/gcc-in-cxx that now gcc is compiled using C++. However, the very first line of the description confused me. It says: GCC has

Re: RFC - Alternatives to gengtype

2012-11-16 Thread Uday P. Khedker
Basile Starynkevitch wrote, On Friday 16 November 2012 03:36 PM: To be more specific, I call garbage collection a scheme where (small newbie) GCC contributors can contribute easily some code to GCC without having to understand when, and how precisely, some data will be freed. If a user adds

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-12 Thread Uday P. Khedker
Excellent! Thanks. Uday. Richard Biener wrote, On Friday 12 October 2012 03:20 PM: On Fri, Oct 12, 2012 at 11:46 AM, Uday P. Khedker wrote: Richard Biener wrote, On Friday 12 October 2012 02:51 PM: we _always_ see ssa_name_1 = a; use (ssa_name_1); so you have a place to

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-12 Thread Uday P. Khedker
Richard Biener wrote, On Friday 12 October 2012 02:51 PM: we _always_ see ssa_name_1 = a; use (ssa_name_1); so you have a place to associate your flow-sensitive and context-sensitive points-to-info with (the SSA name). My point is that for _using_ the points-to info flow-sensitivity p

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-11 Thread Uday P. Khedker
Andrew Pinski wrote, On Friday 12 October 2012 11:26 AM: Except the problem here is just about what f1 clobbers. Since a has not escaped by the time f1 is called, f1 cannot clobber a (or d). http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23384 for reference on why GCC gets this incorrect. GCC

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-11 Thread Uday P. Khedker
decided to hold the address of a into a1 through function f1, let me eliminate the call to f1 and make the assignment a=&w live in some other way. Here's the changed code: Please read it as "eliminate the call passing a to f1". Uday.

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-11 Thread Uday P. Khedker
Andrew Pinski wrote, On Friday 12 October 2012 10:29 AM: Here's an example: main() { int **p; int *a, *d; int w, x; a = &w; f1(a); p = &a; a = &x; f2(p); d = a; return *d; } It is clear that d can onl

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-11 Thread Uday P. Khedker
Diego Novillo wrote, On Friday 12 October 2012 01:41 AM: On Thu, Oct 11, 2012 at 11:53 AM, Uday P. Khedker wrote: That's actually not true. In fact existing GCC pointer analysis is flow-sensitive for all SSA pointers. SSA provides partial flow sensitivity to the top level poi

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-11 Thread Uday P. Khedker
That's actually not true. In fact existing GCC pointer analysis is flow-sensitive for all SSA pointers. SSA provides partial flow sensitivity to the top level pointers. For deeper pointers, one needs to interleave SSA and points-to analysis. Besides, it cannot handle global pointers which ar

Re: Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-10 Thread Uday P. Khedker
Hi David, This is great progress. Thanks. If I understand the experiments, your implementtion has very small cost to perform the analysis, at least for the SPEC benchmarks you are testing. Have you connected the analysis to any optimizations? Is there any improvement in performance on SPE

Fully flow and context sensitive points-to analysis in GCC 4.6.0

2012-10-10 Thread Uday P. Khedker
We have designed and implemented a fully flow and context sensitive points-to analysis in gcc-4.6.0. For simplicity, we have made a dynamic plugin available at http://www.cse.iitb.ac.in/grc/index.php?page=l-fcpa. This page also provides an overview of the method, and links to the paper, slides

Tutorial on Essential Abstractions in GCC

2011-03-09 Thread Uday P. Khedker
Dear Friends, Andi's document is quite helpful and I may use some information from it in my tutorial being conducted along with CGO conference at Chamonix, France on 2nd April. Novices may find it useful to attend it. The relevant details can be found at: - http://www.cgo.org/cgo2011/tut

Re: Dedicated logical instructions

2010-11-10 Thread Uday P. Khedker
I have 16 vectorial registers in the machine R16-R31 which all have 128 cells of 16 bits each. These support ALU operations and load/stores just as normal registers, but in one clock. So an add R16 R17 R18 will add the whole R17 array with R18 (corresponding cells) and place the result in R1

Reverse mapping from decl uid

2010-09-18 Thread Uday P. Khedker
Given a tree node, we can get its uid by using DECL_UID(node). Given a uid, is it possible to directly get the tree node that corresponds to it? I can of course make a list of nodes that I am interested in but if there is an API, I would much rather use it. Thanks. Uday. P.S. : Earlier, I hav

Re: rationale for eliding modifications to string constants

2010-09-14 Thread Uday P. Khedker
You got me there :-) Yes you are right. The reason I gave for dead code elimination is not sound! Should have thought a bit before writing :-( Uday. Axel Freyn wrote, On Wednesday 15 September 2010 12:05 AM: Hello Uday, On Tue, Sep 14, 2010 at 11:50:11PM +0530, Uday P. Khedker wrote

Re: rationale for eliding modifications to string constants

2010-09-14 Thread Uday P. Khedker
, Uday P. Khedker wrote: The point is: in your program is is only a pointer. When you pass s as a parameter to printf, the compiler assumes that only s is being used so the (effective) assignment *s = 'H' is deleted as dead code when optimization is enabled. No, this is incorrect.

Re: rationale for eliding modifications to string constants

2010-09-14 Thread Uday P. Khedker
Interesting example indeed! Replace the declaration of s to char s[] = "hello"; and see "Hello" being printed :-) The point is: in your program is is only a pointer. When you pass s as a parameter to printf, the compiler assumes that only s is being used so the (effective) assignment

Re: Guidance needed: hi-level steps to track an object until its destruction

2010-08-29 Thread Uday P. Khedker
acks their lifespan? On Sun, Aug 29, 2010 at 4:43 AM, Uday P. Khedker wrote: I am not sure that is easily feasible. I would believe it is impossible. Within the compiler (or inside a GCC plugin, or inside a GCC extension coded in MELT), you probably are able change/inspect C++ classes&

Re: Guidance needed: hi-level steps to track an object until its destruction

2010-08-29 Thread Uday P. Khedker
I am not sure that is easily feasible. I would believe it is impossible. Within the compiler (or inside a GCC plugin, or inside a GCC extension coded in MELT), you probably are able change/inspect C++ classes& every other declaration any compiler is tracking. You are also able to find every oc

Re: Research Region Based Memory Management for Imperative Languages

2010-08-27 Thread Uday P. Khedker
We have had a long term plan (which has not fructified until now) of implementing a static analysis for improving garbage collection. Our paper in TOPLAS (http://portal.acm.org/citation.cfm?id=1290521) describes our early work. The main bottle neck for our purpose is a good pointer analysis and we

Re: about emit_move_insn in define_expand

2008-12-18 Thread Uday P. Khedker
s[1]=force_reg(SImode,operands[1]); } > printf("Here1\n");emit_move_insn (operands[0], operands[1]); > printf("Here2\n");DONE; } else > printf("Here3\n"); }) > I should read more code in backend to avoid making such proble