Re: Make some comdats implicitly hidden

2013-08-29 Thread Jan Hubicka
M > Hi, > > On 08/29/2013 10:11 AM, Jan Hubicka wrote: > >Paolo, > >there seems to be one extra issue about this patch. It causes quite a twist > >in libstdc++ exported symbols. > >It is purpose of the patch to remove those that are going to be generated i

Re: [RFA] Type inheritance graph analysis & speculative devirtualization, part 4/7, ODR at LTO time

2013-08-29 Thread Jan Hubicka
Richard, Jason, I would apprechiate your opinion on this patch. It blocks all the code that makes use of ipa-devirt post LTO streaming. The main part that I would like to know your opinion on is the ODR rule implementation by vtable comparsion (it looks obvious but I got it wrong once already)

Re: [RFC] Old school parallelization of WPA streaming

2013-08-29 Thread Jan Hubicka
Jakub, I am adding you to CC since I put my current toughts on LTO and debug info in here. > > Fork-fire-forget is really a much simpler choice here IMO; no worries > > about shared resources, less debug hassle. > > It might be not as cheap as it is on Linux hosts on other hosts of > course. Als

Re: Make some comdats implicitly hidden

2013-08-29 Thread Jan Hubicka
> Hi, > > On 08/29/2013 02:19 PM, Jan Hubicka wrote: > >So my belief is that it is safe to drop those symbols from > >libstdc++. Every program/DSO using them have to define its own > >copy of those symbols, so I believe removing them from libstdc++ > >won

Re: Make some comdats implicitly hidden

2013-08-29 Thread Jan Hubicka
> On Thu, Aug 29, 2013 at 02:47:46PM +0200, Paolo Carlini wrote: > > On 08/29/2013 02:19 PM, Jan Hubicka wrote: > > >So my belief is that it is safe to drop those symbols from > > >libstdc++. Every program/DSO using them have to define its own > > >copy of those

Re: [RFC] Old school parallelization of WPA streaming

2013-08-29 Thread Jan Hubicka
> > Said that, I now have the fork() patch in all my trees and enjoy 50% faster > > WPA times. I changed my mind about claim that stremaing should be disk > > bound - > > it is hard to hope for disk boundness for something that should fit in > > cache. > > It should at least limit its fork rate

Merge profiles of duplicated COMDAT functions

2013-08-30 Thread Jan Hubicka
Hi, this patch makes COMDAT profiles right with LTO. (made jointly with Martin Liska) To recap the issue: COMDAT functions are produced many times. Each copy gets its own set of counters and depending on inlining and linker decision, one or more of copies of a given COMDAT function will get exe

Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition

2013-08-30 Thread Jan Hubicka
> Great! Is this the LTO merging you were talking about in an earlier > message, or the gcov runtime fix (that would presumably not be > lto-specific)? It is the LTO path - we need to merge profiles there anyway for his code unification work. > > I have patch to track this. Moreover vforks seem

Re: COMDAT missing profile handling (was Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition)

2013-08-30 Thread Jan Hubicka
> > The esitmated profile is already there before reading the profile in, so we > > only do not want to overwrite it. Does the following work for you? > > It does get the estimated frequencies on the bbs. Good. > > We wil also need to solve problem that in this case cgraph edges will have > >

Re: Merge profiles of duplicated COMDAT functions

2013-08-30 Thread Jan Hubicka
> > Please instead remove this assert and put the checking into > tree-cfg.c:verify_gimple_label where it should need no special-casing > on cgraph_state. > > Otherwise the non-profile bits look ok. OK, will do. Thank you! Honza

Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition

2013-08-30 Thread Jan Hubicka
> > > > The frequency condition needs to be done only when you walk predecestors - > > when > > you walk down the edge probabilities are just fine. > > True. For simplicity I think it should be fine to leave as-is so there > isn't more special casing as the current approach works in both > direct

Re: Merge profiles of duplicated COMDAT functions

2013-08-30 Thread Jan Hubicka
> Jan Hubicka writes: > > > > Now for longer term, we want to make function CFGs independent of gimple > > body > > and we want to decide on instrumentation at linktime, so we won't require > > user > > to rebuild with -fprofile-use, just relink.

More weakref fixes

2013-08-30 Thread Jan Hubicka
Hi, this patch fixes gcc.dg/tree-ssa/attr-alias.c on x86-64 target. The problem here is that we attempt to create local alias since we consider weakref of test() to be overwritable and at the same time available. The change in cgraph_function_body_availability makes weakref to properly inherit av

Re: Fix OBJ_TYPE_REF handling in ipa-cp

2013-08-31 Thread Jan Hubicka
> > Bootstrapped/regtesed x86_64-linux. Martin, please can you review the > > change? > > > > * ipa-prop.c (ipa_set_jf_known_type): Check that component type > > is a record type with BINFO. > > (detect_type_change_ssa): Add comp_type argument. > > (compute_complex_assign_jump_fu

Fix integer overflow when scaling counts in inliner

2013-08-31 Thread Jan Hubicka
. Bootstrapped/regtested x86_64-linux, comitted. Honza Index: ChangeLog === --- ChangeLog (revision 202127) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2013-08-31 Jan Hubicka + + * basic-block.h (apply_scale): Make scale

Fix speculative edge reference lookup

2013-08-31 Thread Jan Hubicka
=== --- ChangeLog (revision 202128) +++ ChangeLog (working copy) @@ -1,5 +1,9 @@ 2013-08-31 Jan Hubicka + * cgraph.c (cgraph_speculative_call_info): Fix ref lookup + +2013-08-31 Jan Hubicka + * basic-block.h (apply_scale): Make

Fix fork instrumentation for libgcov

2013-08-31 Thread Jan Hubicka
Hi, as noticed by Martin Liska, -O0 -fprofile-generate code won't land into __gcov_fork. This is due to early exit from expand_builtin. Fixed and will be comitted as obvious. Honza * builtins.c (expand_builtin): Do not exit early for gcov instrumented functions. * gcc.dg/f

Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition

2013-08-31 Thread Jan Hubicka
Hi, With Martin we made script for testing the profiling failures. First do ld --verbose >~/script then apply --- /home/jh/script22013-08-31 17:59:11.0 +0200 +++ /home/jh/script 2013-08-31 17:39:40.0 +0200 @@ -1,12 +1,3 @@ -GNU ld (GNU Binutils for Debian) 2.20.1-system.2

Remove hash from remember_with_vars

2013-08-31 Thread Jan Hubicka
Hi, remember_with_vars walks trees that are read from file (now unique) and looks for fields that can contain pointers to vars or functions and if so, it records them to global hashtable for later fixup. This is quite wasteful, because the hash is querried many times. We can simply walk all fields

Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition

2013-08-31 Thread Jan Hubicka
Hi, I run my script on execute testsuite and looked into few testcases. The problem I found was roundoff errors - i.e. when expanding switch we set 50% chage that out of bound value is above or bellow. Both gets rounded to 0, because switch is executed once and the value is bellow. Partly this

Type inheritance graph analysis & speculative devirtualization, part 7/7 (speculative devirtualizatoin)

2013-09-01 Thread Jan Hubicka
Hi, this patch implement speculative devirtualization. It is a trivial pass that asks for targets of every polymorphic call in a program and if the list contains one likely target, it produces an speculative call. No context sensitive analysis is done at the moment. This call may or may not survi

Re: Type inheritance graph analysis & speculative devirtualization, part 7/7 (speculative devirtualizatoin)

2013-09-01 Thread Jan Hubicka
> Missing test cases? Good point. The testcases I have needs rest of the patches from the series to hit the mainline. For now I have added the following to test the basic scenario * g++.dg/ipa/devirt-15.C: New testcase. Index: g++.dg/ipa/devirt-15.C ==

Move ipa-profile pass into separate file

2013-09-01 Thread Jan Hubicka
Hi, once simple pass has grown up into set of not-so-trivial profile based transformations. This patch merely moves it to separate file. I intend to add toplevel comment and fix interesting problem Martin Liska noticed in followup patch. I did some basic housekeeping of include files and depend

Re: [RFA] Type inheritance graph analysis & speculative devirtualization, part 4/7, ODR at LTO time

2013-09-01 Thread Jan Hubicka
> On 08/19/2013 10:01 AM, Jan Hubicka wrote: > >+ /* All equivalent types, if more than one. */ > >+ vec *types; > >+ /* Set of all equivalent types, if NON-NULL. */ > >+ pointer_set_t * GTY((skip)) types_set; > > Why do you need both a vector and a

Re: [PATCH, PR 58106] Make ipa_edge_duplication_hook cope with recursive inlining

2013-09-02 Thread Jan Hubicka
> 2013-08-27 Martin Jambor > > PR ipa/58106 > * ipa-prop.c (ipa_edge_duplication_hook): Always put new rdesc to the > linked list. When finding the correct duplicate, also consider also > the caller in additon to its inlined_to node. > > testsuite/ > * gcc.dg/ipa

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
> On Aug 21, 2013, at 11:47 PM, Jan Hubicka wrote: > >> The problem is that DECL_ARGUMENTS of the thunk (aka _ZThn528_N1D3fooEv) > >> is used during thunk code-generation, and thunk code-generation happens > >> during the output of D::foo. > > > I see, I

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
> > + tree a; > > + > > + if (in_lto_p) > > +cgraph_get_body (node); > > That looks gross. It cannot possibly be the correct fix for this. DECL_ARGUMENTS/DECL_RESULT are now part of function body. cgraph_get_body is there to load it for you when you need it. We are going to expand the func

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
> > Well, there is still fallout from this change so I'm not convinced > this will stay > this way. Also we stream the function-decl that refers to these fields in As far as I know there are two problems 1) problem with the thunk expansion not getting DECL_ARGUMENTS/DECL_RESULT addressed by

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
> > > > Well, there is still fallout from this change so I'm not convinced > > this will stay > > this way. Also we stream the function-decl that refers to these fields in > > As far as I know there are two problems > 1) problem with the thunk expansion not getting DECL_ARGUMENTS/DECL_RESULT >

Re: Remove hash from remember_with_vars

2013-09-02 Thread Jan Hubicka
fallout I caused this week. Honza Index: ChangeLog === --- ChangeLog (revision 202173) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2013-08-31 Jan Hubicka + * lto.c (mentions_vars_p_field_decl

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
> > But we still refer to the local entity from TREE_TYPE of the function decl, > no? depending on definition of local entity. I tought we was discussing if PARM_DECL is local or not. I spent some time thining about the whole streaming scheme and I think we do have important side cases handle

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
Hi, the following testcase illustrate problem with the offset. Sadly it ICEs even w/o LTO: evans:/abuild/jh/trunk-3/build-inst12/gcc/:[1]# ./xgcc -B ./ -O2 ~/tt.c /root/tt.c: In function 'main': /root/tt.c:24:11: warning: overflow in implicit constant conversion [-Woverflow] b.b=

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-02 Thread Jan Hubicka
Hi, also to avoid the ICE in the original testcase, we do not really need the DECL_ARGUMENTS/RESULT_DECL lists. All we need is RESULT_DECL in the global stream. The following one liner fixes the testcase and all variants of my ulitimate death testcase that did not ICE in tree from beggining of Au

Fix gcc.dg/lto/20090218-1.c

2013-09-02 Thread Jan Hubicka
Hi, gcc.dg/lto/20090218-1.c contains cross module call into always_inline function. At -O0 -flto we used to report nothing since optimize_inline_calls was not called. With my change we report it as error. I am not sure what is desired behaviour, but for now I am restoring the previous situation

Fix gcc.dg/lto/pr56297 failure

2013-09-02 Thread Jan Hubicka
Hi, this patch fixes gcc.dg/lto/pr56297 failure. Here we have two modules defining global variable assigned to hard registers. Those variables do not go into assembler name hash because they have no real assembler name and consequentely they are not merged. We however may end up with two declarat

Cleanup CFG after profile read/instrumentation

2013-09-02 Thread Jan Hubicka
Hi, reading profile/instrumenting breaks basic blocks and introduces fake edges. The broken basic blocks are not re-merged until after LTO streaming that is wasteful. Fixed thus. Profiledbotostrapped/regtsted ppc64-linux, comitted. Index: tree-profile.c ==

Re: Symtab cleanup 10/17 remove unnecesary DECL_ARGUMENTS and DECL_RESULT

2013-09-03 Thread Jan Hubicka
> > The decision what should go to local or global stream is basically > > motivated by > > 1) everything needed for interprocedural optimization has to be global > > 2) everything related to function bodies should be local. > > I'd rather formulate it as "everything not needed at WPA time sh

Re: Type inheritance graph analysis & speculative devirtualization, part 7/7 (speculative devirtualizatoin)

2013-09-03 Thread Jan Hubicka
> What is the footprint impact of speculative devirtualization? It is less than 2% of text section and once we solve problems with ipa-prop tracking, I hope it will be less. I hope we now understand better how to devirtualize and I think we can improve non-speculative devirt noticeably. > > F

Re: [PATCH 0/6] Convert gimple to a C++ class hierarchy

2013-09-04 Thread Jan Hubicka
> On Mon, 2013-09-02 at 14:35 +0200, Martin Jambor wrote: > > Hi, > > > > On Fri, Aug 30, 2013 at 03:21:22PM -0400, David Malcolm wrote: > > > Apart from the GTY aspect, how do people feel about the patch series? > > > FWIW I have vague thoughts about doing something similar for tree - > > > doing

[RFC] Fix for PR58201

2013-09-04 Thread Jan Hubicka
Hi, this is third fallout of my change to remove DECL_ARGUMENTS/DECL_RESULT for functions w/o bodies I did not really anticipate. Here removal of the arguments changes mangling algorithm if set_decl_assembler_name is invoked late. This is something I wanted to get rid of for a long time: we alr

Fix long lines in cgraphunit.c

2013-09-04 Thread Jan Hubicka
Hi, as Michael pointed out, I introduced long lines primarily because of large indentation in cgraph_analyze_function. It makes the code to look better if the polymorphic call logic in broken out. Bootstrapping/regtesting x86_64-linux, will commit it once testing conlcude. Honza * cgraphu

Re: [RFC] Fix for PR58201

2013-09-04 Thread Jan Hubicka
> On 09/04/2013 06:04 PM, Jan Hubicka wrote: > > this is third fallout of my change to remove DECL_ARGUMENTS/DECL_RESULT for > > functions w/o > > bodies I did not really anticipate. > [...] > > I would like to basically ask if it seems to make sense to go this r

Re: [RFC] Fix for PR58201

2013-09-05 Thread Jan Hubicka
> On 09/04/2013 10:49 AM, Bernd Schmidt wrote: > >On 09/04/2013 06:04 PM, Jan Hubicka wrote: > >>this is third fallout of my change to remove DECL_ARGUMENTS/DECL_RESULT for > >>functions w/o > >>bodies I did not really anticipate. > >[...] > >&g

Silence gcc.dg/autopar/pr49960.c

2013-09-05 Thread Jan Hubicka
inlining until we have IPA value range propagation. Comitted as obvoius. Honza Index: ChangeLog === --- ChangeLog (revision 202296) +++ ChangeLog (working copy) @@ -1,3 +1,6 @@ +2013-09-05 Jan Hubicka + + * gcc.dg/autopar

Fix g++.dg/lto/20090311 and g++.dg/lto/20091210-1 on some setups

2013-09-05 Thread Jan Hubicka
Hi, ipa-devirt uses mangled names to establish equivalence in between symbols. I added assert for cloned names, since I convinced myself that otherwise we can miss matches in between local static symbols. I also convinced myself we should never rename. I was wrong on both: declaration merging mak

Re: [RFC] Fix for PR58201

2013-09-05 Thread Jan Hubicka
Hi, this is the patch I commited after testing on x86_64-linux. Honza Index: ChangeLog === *** ChangeLog (revision 202271) --- ChangeLog (working copy) *** *** 1,3 --- 1,9 + 2013-09-04 Jan Hubicka

Re: Silence gcc.dg/autopar/pr49960.c

2013-09-06 Thread Jan Hubicka
> > +2013-09-05 Jan Hubicka > > + > > + * gcc.dg/autopar/pr49960.c: Disable partial inlining > > 2013-09-05 Richard Biener > > Please add a blank line between entries? The actual commmit has the extra line. Not sure why the patch doesn't. Sorry for that. Honza

Re: [patch] Fix another fallout of partial inlining change

2013-09-06 Thread Jan Hubicka
> Hi, > > see http://gcc.gnu.org/ml/gcc/2013-09/msg00028.html for the context. > The patch sets DECL_NO_INLINE_WARNING_P on the non-inlinable part after > splitting (an alternative would be to clear DECL_DECLARED_INLINE_P). Sorry, I missed your mail and it seems that my original mail did not hit

Fix ipa-devirt-11.C on AIX part 1

2013-09-06 Thread Jan Hubicka
Hi, ipa-devirt-11.C (invented by me) checks for series of events that lead to an ICE. With local alias changes these events are not happening for multiple reasons. This patch solves first problem: we now redirect call to a function to call to its alias and that breaks detection of self recursion

Fix ipa-devirt-11.C on AIX part 2

2013-09-06 Thread Jan Hubicka
Hi, this patch makes tree-sra to do its job in the case where function has an alias. There were two problems; first recursion is not detected correctly and second we did not see the callers and thus skipped the function. Rest of tree-sra seems to work as expected. Bootstrapped/regtsted x86_64-li

Fix ICE with -O0 -fdevirtualize

2013-09-06 Thread Jan Hubicka
Hi, this patch fixes ICE with -O0 -fdevirtualize where we try to access type inheritance graph that does not exist. Bootstrapped/regtested x86_64-linux, comitted. 2013-09-06 Jan Hubicka PR tree-optimization/58311 * ipa-devirt.c (gate_ipa_devirt): Only execute when optimizing

Fix ipa-devirt-11.C on AIX part 3

2013-09-06 Thread Jan Hubicka
Hi, this patch makes inlining of functions called once to work even if they are called by alias. Bootstrapped/regtested x86_64-linux, comitted. PR middle-end/58094 * ipa-inline.c (has_caller_p): New function. (want_inline_function_to_all_callers_p): Use it. (sum_c

Re: [RFC] Fix for PR58201

2013-09-07 Thread Jan Hubicka
> >+ 2013-09-04 Jan Hubicka > >+ > >+PR middle-end/58201 > >+* cgraphunit.c (analyze_functions): Clear AUX fields > >+after processing; initialize assembler name has. > >+ > I checked and double checked and with this commit a C++ test regres

Fix gimple thunks

2013-09-07 Thread Jan Hubicka
Hi, this is a variant of patch I tested and comitted after discussion on DECL_ARGUMENTS change. Basically ARGUMENTS are now part of a functio nbody and we need to stream them for thunks in order to be able to expand them. The patch also fixes misplaced pop_cfun in lto-streamer-in.c. Bootstrapp

Re: [RFC] Fix for PR58201

2013-09-07 Thread Jan Hubicka
> > >+ 2013-09-04 Jan Hubicka > > >+ > > >+ PR middle-end/58201 > > >+ * cgraphunit.c (analyze_functions): Clear AUX fields > > >+ after processing; initialize assembler name has. > > >+ > > I checked and double checked and

Re: [RFC] Fix for PR58201

2013-09-07 Thread Jan Hubicka
> Hi Honza, > > and thanks for the analysis, now I understand the issue a little more. > > On 09/07/2013 10:28 AM, Jan Hubicka wrote: > >So it is just an accident that the line info is output sanely (if > >line 9 is sane, I don't exactly know) > I would say t

Re: [RFC] Fix for PR58201

2013-09-07 Thread Jan Hubicka
> Hi all, Jakub, > > On 09/07/2013 01:16 PM, Jakub Jelinek wrote: > >As I wrote in the PR, IMHO mangle_decl should > > location_t save_location = input_location; > > input_location = DECL_SOURCE_LOCATION (decl); > >... > > input_location = save_location; > >around the call, > I had a look an

Re: [RFC] Fix for PR58201

2013-09-07 Thread Jan Hubicka
> > Hi all, Jakub, > > > > On 09/07/2013 01:16 PM, Jakub Jelinek wrote: > > >As I wrote in the PR, IMHO mangle_decl should > > > location_t save_location = input_location; > > > input_location = DECL_SOURCE_LOCATION (decl); > > >... > > > input_location = save_location; > > >around the call,

Add varpool node removal/insertion hooks

2013-09-08 Thread Jan Hubicka
Hi, this patch adds API for varpool node removal/insertion hooks that are fully symmetric to cgraph code. Bootstrapped/regtested x86_64-linux after working around PR58340, will commit it shortly. Honza * cgraph.h (varpool_node_hook, varpool_node_hook_list, varpool_add_node_rem

Re: Add varpool node removal/insertion hooks

2013-09-08 Thread Jan Hubicka
> On Sun, Sep 8, 2013 at 9:23 AM, Jan Hubicka wrote: > > Hi, > > this patch adds API for varpool node removal/insertion hooks that are fully > > symmetric > > to cgraph code. > > > > Bootstrapped/regtested x86_64-linux after working around PR58340, wil

Type inheritance graph analysis & speculative devirtualization, part 4/7 (unreachable virtual method removal)

2013-09-08 Thread Jan Hubicka
Hi, this patch make symtab_remove_unreachable_nodes to use polymorphic call analysis same was as the cgraph construction code. The use is basically simple - instead of marking all virtual functions as potentially reachable until inlining, we mark only those that appear in the list of possible targ

Re: *PING* Re: [PATCH] Fix handling of very long asm statements in inliner

2013-09-08 Thread Jan Hubicka
> Andi Kleen writes: > > Ping! > > This problem is still open, and afaik no better solution has been > proposed. It is also a regression. > > Is it ok to commit if I rerun the tests and they pass? OK. Honza

Enable reference removal for speculative edges

2013-09-08 Thread Jan Hubicka
Hi, this hack I put on place since ipa-prop was breaking without it. Martin fixed the problem and I tested it can now be removed for Firefx build. Bootstrapped/regtested x86_64-linux, comitted. * ipa-prop.c (try_make_edge_direct_simple_call): Do not special case speculative edge

Fix redirection in ipa.c

2013-09-08 Thread Jan Hubicka
Hi, this patch fixes ICE when edge redirection happens just before summary generation. At that time we still don't want edges to be redirected when underlying statements are not. Bootstrapped/regtested x86_64-linux, comitted. * ipa.c (walk_polymorphic_call_targets): Fix redirection befo

Re: [PATCH, x86] Use vector moves in memmove expanding

2013-09-09 Thread Jan Hubicka
> Hi HJ, > You were right, and the change from epilogue_size_needed to size_needed was > the > rootcause of the bug. > Here is the obvious fix for that, regtested and bootstrapped on i386/x86_64. > > Is it OK for trunk? > > Changelog: > 2013-09-09 Michael Zolotukhin > > * config/i386/i

Avoid ipa-profile dropping functions unlikely when profile is read

2013-09-09 Thread Jan Hubicka
Hi, ipa-profile does propagation across the CFG in attempt to prove that function is cold. This is counter-productive when profile is read and we can easilly work this out from count itself. This patch makes it less agressive in this setting and it also put ipa-profile into busyness to make coun

Re: [PATCH] Make IPA-CP work when there are SCCs of call graph nodes represented by a thunk

2013-09-10 Thread Jan Hubicka
> Hi, > > until recently we did not have thunks with incoming edges in the call > graph. However, speculative devirtualization can introduce them which We did, just not very often. Normal devirtualization code can produce them, too. > may lead to creation of new SCCs in the call graph. What i

Re: [PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.

2013-09-10 Thread Jan Hubicka
> Here's version 2 of this patch series. > > This is now 6 patches. > > The first two patches correspond to the two patches from the original > patch series (and must both be applied together to make sense). They > convert cgraph_node and varpool_node to inherit from symtab_node_base, > eliminat

Re: [PATCH v2 1/6] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-10 Thread Jan Hubicka
> This patch is the handwritten part of the conversion of these types > to C++; it requires the followup patch, which is autogenerated. > > It converts: > struct GTY(()) symtab_node_base > to: > class GTY((user)) symtab_node_base > > and converts: > struct GTY(()) cgraph_node > to: > stru

Re: [PATCH v2 3/6] Split symtab_node declarations onto multiple lines

2013-09-10 Thread Jan Hubicka
> Amongst other things, the rename_symtab.py script converts > "symtab_node" to "symtab_node *". > > This will lead to broken code on declarations that declare > more than one variable (only the first would get a "*"), so split > up such declarations. > > gcc/ > * cgraphunit.c (analyze_func

Re: [PATCH v2 2/6] Automated conversion of symtab to class hierarchy

2013-09-10 Thread Jan Hubicka
> This patch is 439KB in size, so to avoid mailing-list limitations I've > uploaded it to: > http://dmalcolm.fedorapeople.org/gcc/large-patches/fd607e77883b8d3f8fb7c8091d0626dbbd31b9a5-0002-Automated-conversion-of-symtab-to-class-hierarchy.patch OK, thanks! Honza

Re: [PATCH v2 4/6] Remove symtab_node and const_symtab_node typedefs.

2013-09-10 Thread Jan Hubicka
> gcc/ > > * ipa-ref.h (symtab_node): Remove typedef to pointer type, as it > clashes with the preferred name for the base class. > (const_symtab_node): Remove redundant typedef. This is OK, too. Actually it is not only clash - it was really inconsistent to write symtab_node nod

Re: [PATCH v2 5/6] Automated renaming of symtab types

2013-09-10 Thread Jan Hubicka
> gcc/ > > Patch autogenerated by rename_symtab.py from > https://github.com/davidmalcolm/gcc-refactoring-scripts > revision 714e57b66b08fb29f47826fbb642707bdfa19520 OK, thanks! Honza

Re: [PATCH v2 6/6] Update hand-written GTY routines for type renaming

2013-09-10 Thread Jan Hubicka
> * cgraph.c (gt_ggc_mx): Update for renaming of symtab_node_base > to symtab_node > (gt_pch_nx): Likewise. > --- > gcc/cgraph.c | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/gcc/cgraph.c b/gcc/cgraph.c > index bb2626d..abbff

Fix overactive devirtualization to external functions

2013-09-10 Thread Jan Hubicka
Hi, fold_ctor_reference expects VAR or FUNCTION_DECL as FROM_DECL parameter. gimple_get_virt_method_for_binfo instead passes expression (pointer_plus_expr (addr_expr vtable_decl) (integer_cst XXX)) This bug makes can_refere_from_current_unit_p to mistakely think that the references are safe because

Consider polymorphic call targets to be part of boundary

2013-09-10 Thread Jan Hubicka
Hi, this patch adds polymorphic call targets into the boundary of an unit. This enables more late devirtualization. I briefly measured size on effect of WPA->ltrans files on firefox and they still seem to be around 2GB. Bootstrapped/regtested x86_64-linux, comitted. * lto-cgraph.c: Inc

Enable ipa-deivrt with LTO

2013-09-10 Thread Jan Hubicka
Hi, All the latent issues wthat ipa-devirt has triggered has been hopefully fixed. So I am enabling ipa-devirt with LTO. To answer original David's comment on non-LTO performance, I did not really noticed any significant improvements/dergradations at -O2 with our benchmarks (SPEC2k, 2k6 and C++

Re: [PATCH, PR 58389] Do not attempt to use reference descriptions associated with removed edges

2013-09-12 Thread Jan Hubicka
> Hi, > > PR 58389 is another case where the reference removal code, which is > now also called from the edge removal hook, ICEs when inlined edges > are not removed in topological order, which ins not the case when we > are removing unreachable nodes. > > I'd like to fix it by the patch below.

[RFC] Unifying logic of interprocedural/intraprocedural and ipa-devirt type handling

2013-09-12 Thread Jan Hubicka
Hi, this is a streghtening of current ipa-devirt type walking I was working on in past weeks. My initial implementation of inheritance tree analysis simply take OTR_TYPE that is the type of class of the polymorphic call and OTR_TOKEN that is an index of virtual method in the vtable. It always wal

Fix ipa-devirt-11.C on AIX part 4

2013-09-13 Thread Jan Hubicka
) @@ -1,3 +1,8 @@ +2013-09-13 Jan Hubicka + + * ipa-inline-analysis.c (struct growth_data): Add node. + (do_estimate_growth_1): Fix detection of recursion. + 2013-09-13 Jakub Jelinek PR tree-optimization/58392 Index: ipa-inline-analysis.c

Expand Gimple thunks early

2013-09-13 Thread Jan Hubicka
Hi, with improvements on devirtualization side, the thunks are getting more problematic for optimizers. Inliner won't inline them, profiling won't instrument them and there are other places where they bock optimization. This patch solves part of the problem by making gimple thunks to go same way

Re: Recent IPA regression with internal functions

2013-09-15 Thread Jan Hubicka
> 2013-09-13 Jakub Jelinek > > * ipa-prop.c (ipa_compute_jump_functions_for_edge): Return early > for internal calls. That seems resonable. I wonder if we want to consider internal calls to form callgarph edges at all: perhaps we can just modify cgraph builder+verifier to skip the

Fix can_refer_decl_in_current_unit_p wrt optimized out statics

2013-09-16 Thread Jan Hubicka
Hi, this patch solves problem with can_refer_decl_in_current_unit_p always returning true for static functions. The devirtualization code can look up a method in anonymous namespace that has been optimized out due to lack of references to any of vtables mentioning it. In this case we need to make

Re: Recent IPA regression with internal functions

2013-09-16 Thread Jan Hubicka
> On Sun, Sep 15, 2013 at 09:08:00PM +0200, Jan Hubicka wrote: > > > 2013-09-13 Jakub Jelinek > > > > > > * ipa-prop.c (ipa_compute_jump_functions_for_edge): Return early > > > for internal calls. > > > > That seems resonable. I wonder

Re: [PATCH, PR 58398] Fix regression in gcc.dg/attr-ifunc-4.c

2013-09-17 Thread Jan Hubicka
> The attached patch fixes the regression in gcc.dg/attr-ifunc-4.c (PR 58398). > > The problem is that the resolver function just looks like an alias, but it > actually is > something completely different. So inlining the resolver function has to be > avoided. > > The patch was bootstrapped and

Disable creation of local aliases on targets w/o alias support

2013-09-17 Thread Jan Hubicka
Hi, this patch should fix HP-PA bootstrap issue where we create local aliases but the target has no support for them. Bootstrapped/regtested x86_64-linux (with aliases disabled) and commited. PR middle-end/58329 * ipa-devirt.c (ipa_devirt): Be ready for symtab_nonoverwritable_ali

Fix PR58332

2013-09-17 Thread Jan Hubicka
Hi, this patch makes inliner to not inline functions with -O0 optimization attribute and also to not inline into functions. Bootstrapped/regtested x86_64-linux, comitted. PR middle-end/58332 * gcc.c-torture/compile/pr58332.c: New testcase. * cif-code.def (FUNCTION_NOT_OPTIM

Re: [PATCH v2 1/6] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-18 Thread Jan Hubicka
> > > +cgraph_node *cgn = static_cast (x); > > > +gt_ggc_m_11cgraph_edge (cgn->callers); > > > +gt_ggc_m_11cgraph_node (cgn->origin); > > > +gt_ggc_m_11cgraph_node (cgn->nested); > > > +gt_ggc_m_11cgraph_node (cgn->next_nested); > > > +

Re: [ping][PATCH][1 of 2] Add value range info to SSA_NAME for zero sign extension elimination in RTL

2013-09-18 Thread Jan Hubicka
> On Wed, Sep 18, 2013 at 10:57:57AM +0200, Richard Biener wrote: > > On Wed, 18 Sep 2013, Richard Earnshaw wrote: > > > > > On 16/09/13 15:13, Richard Biener wrote: > > > > +void > > > > +get_range_info (tree name, double_int &min, double_int &max, > > > > +enum value_range_type &

Fix uninitialized memory access in cgraph.c

2013-09-19 Thread Jan Hubicka
+1,8 @@ +2013-09-19 Jan Hubicka + + * cgraph.c (cgraph_create_edge_1): Avoid uninitialized read + of speculative flag. + 2013-09-19 Jakub Jelinek * omp-low.c (expand_omp_sections): Always pass len - 1 to Index: cgraph.c

Re: Drop generic32 cost model

2013-09-19 Thread Jan Hubicka
> > > decide_alg is being called from ix86_expand_movmem, from > expand_builtin_memcpy, for the call at line 61 of go-append.c. > __builtin_memcpy (n, a.__values, a.__count * element_size); > > I'm continuing to look. Indeed it is problem of this patch - the issue is that generic64 had du

Re: Drop generic32 cost model

2013-09-19 Thread Jan Hubicka
> > I did some experiment with code alignment. I found > -fno-align-loops -fno-align-functions -fno-align-jumps > had no negative performance impacts on current > Intel processors while reducing code sizes by 1-2%. > Should we use > > {&generic_cost, 0, 0, 0, 0, 0}, > > instead? Good, revisitin

Re: [PATCH 3/3] Convert symtab, cgraph and varpool nodes into a real class hierarchy

2013-09-20 Thread Jan Hubicka
> This patch is the handwritten part of the conversion of these types > to C++; it requires the followup patch, which is autogenerated. > > It converts: > struct symtab_node_base > to: > class symtab_node_base > > and converts: > struct cgraph_node > to: > struct cgraph_node : public symt

Re: Drop generic32 cost model

2013-09-20 Thread Jan Hubicka
> On Fri, Sep 20, 2013 at 6:00 AM, Zamyatin, Igor > wrote: > > > > For x86 32-bit is still important due to mobile market so we would like to > > make some measurements first to see how this new generic model works on 32 > > bits I assume by mobile market you mean atom CPU these days (not Pent

Revisit Core tunning flags

2013-09-21 Thread Jan Hubicka
Hi, this is upated version of patch discussed at http://gcc.gnu.org/ml/gcc-patches/2012-12/msg00841.html It makes CORE tuning to more follow the optimization guidelines. In particular it removes some tuning flags for features I implemented years back specifically for K7/K8 chips that ended up in

Re: Revisit Core tunning flags

2013-09-22 Thread Jan Hubicka
> On Sat, Sep 21, 2013 at 3:51 PM, Xinliang David Li wrote: > > On Sat, Sep 21, 2013 at 12:54 PM, Jan Hubicka wrote: > >> Hi, > >> this is upated version of patch discussed at > >> http://gcc.gnu.org/ml/gcc-patches/2012-12/msg00841.html > >>

Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion

2013-09-22 Thread Jan Hubicka
> 2013-09-16 Wei Mi > > * gcc/config/i386/i386-c.c (ix86_target_macros_internal): Separate > PROCESSOR_COREI7_AVX out from PROCESSOR_COREI7. > * gcc/config/i386/i386.c (ix86_option_override_internal): Ditto. > (ix86_issue_rate): Ditto. > (ia32_multipass_d

Re: Fwd: [PATCH] Scheduling result adjustment to enable macro-fusion

2013-09-22 Thread Jan Hubicka
> > I am not sure if AMD hardware has any limitations here. It fuses only > cmp/test This is what Agner Fog says: A CMP or TEST instruction immediately followed by a conditional jump can be fused into a single macro-op. This applies to all versions of the CMP and TEST instructions and all cond

Re: RFA: Store the REG_BR_PROB probability directly as an int

2013-09-22 Thread Jan Hubicka
> Hello Richard, > > Not directly related to your patch but... > > On Sun, Sep 22, 2013 at 12:54 PM, Richard Sandiford wrote: > > @@ -588,14 +589,17 @@ cond_exec_process_if_block (ce_if_block_ > > goto fail; > > #endif > > > > - true_prob_val = find_reg_note (BB_END (test_bb), REG_BR_PROB,

Type inheritance graph analysis & speculative devirtualization, part 4/7 (the verifier)

2013-09-23 Thread Jan Hubicka
Hi, this is the last patch of the series. This patch adds sanity check that all devirtualizations are among ones predicted by possible_polymorphic_call_targets. This sanity check was very useful to chase out numberous problems in this area. The patch check the type based devirtualization to go i

<    2   3   4   5   6   7   8   9   10   11   >