Re: [Google] Refine hot caller heuristic

2013-08-20 Thread Xinliang David Li
Do you need to guard the jump function access with check if (ipa_node_params_vector.exists ())? Ideally, useful_cold_callee should be folded into the inline hints estimation. Question about the heuristic: why filtering out PASS_THROUGH parameter cases completely? Passing 'this' parameter in many

opt-info message change for vectorizer

2013-08-22 Thread Xinliang David Li
URCE_FILE (current_function_decl), - DECL_SOURCE_LINE (current_function_decl)); + DECL_SOURCE_LINE (current_function_decl), + gimple_decl_printable_name (current_function_decl, 1)); } } Index: ChangeLog ==

Re: [GOOGLE] Update AutoFDO annotation

2013-08-26 Thread Xinliang David Li
Can you add missing documentation on functions like ...:get_count_info -- documenting return value etc. Also it might be better to avoid using 'set' as the local variable name. Change it to something more specific. thanks, David On Thu, Aug 22, 2013 at 3:56 PM, Dehao Chen wrote: > This patch h

Re: [GOOGLE] Update AutoFDO annotation

2013-08-27 Thread Xinliang David Li
Ok. David On Tue, Aug 27, 2013 at 7:36 AM, Dehao Chen wrote: > Patch updated. > > Thanks, > Dehao > > On Mon, Aug 26, 2013 at 4:11 PM, Xinliang David Li wrote: >> Can you add missing documentation on functions like ...:get_count_info >> -- documenting return value

Re: [PATCH] Convert more passes to new dump framework

2013-08-27 Thread Xinliang David Li
+ Honza On Tue, Aug 27, 2013 at 10:56 AM, Teresa Johnson wrote: > Ping #3. > > Thanks, > Teresa > > On Mon, Aug 19, 2013 at 11:33 AM, Teresa Johnson wrote: >> Ping. >> Thanks, >> Teresa >> >> On Mon, Aug 12, 2013 at 6:54 AM, Teresa Johnson wrote: >>> On Tue, Aug 6, 2013 at 10:23 PM, Teresa John

Re: opt-info message change for vectorizer

2013-08-27 Thread Xinliang David Li
Does this one look ok? thanks, David On Thu, Aug 22, 2013 at 4:20 PM, Xinliang David Li wrote: > Hi, In this patch, loop alignment peeling and loop versioning > transformation will be reported via -fopt-info by default. This will > help vectorizer size tuning. > > It also enhanc

Re: opt-info message change for vectorizer

2013-08-27 Thread Xinliang David Li
eeds to be fixed to emit the function name > before each block of messages, a la inform(). > > Thanks, > Teresa > > On Tue, Aug 27, 2013 at 11:22 AM, Xinliang David Li > wrote: >> Does this one look ok? >> >> thanks, >> >> David >> >

Re: opt-info message change for vectorizer

2013-08-27 Thread Xinliang David Li
If this is the convention, we should probably have another patch to fix all the existing opt-info messages. thanks, David On Tue, Aug 27, 2013 at 1:23 PM, Mike Stump wrote: > On Aug 27, 2013, at 11:22 AM, Xinliang David Li wrote: >> Does this one look ok? > > We don't c

Re: [PATCH][2/n] 2nd try: Re-organize -fvect-cost-model, enable basic vectorization at -O2

2013-08-27 Thread Xinliang David Li
Richard, I have some comments about the patch. > -ftree-vectorizer-verbose=This switch is deprecated. Use > -fopt-info instead. > > ftree-slp-vectorize > ! Common Report Var(flag_tree_slp_vectorize) Optimization > Enable basic block vectorization (SLP) on trees The code dealing with th

Re: [PATCH] Convert more passes to new dump framework

2013-08-28 Thread Xinliang David Li
On Wed, Aug 28, 2013 at 7:09 AM, Teresa Johnson wrote: > On Wed, Aug 28, 2013 at 4:01 AM, Richard Biener > wrote: >> On Wed, Aug 7, 2013 at 7:23 AM, Teresa Johnson wrote: >>> On Tue, Aug 6, 2013 at 9:29 AM, Teresa Johnson wrote: On Tue, Aug 6, 2013 at 9:01 AM, Martin Jambor wrote: > H

Re: [PATCH][2/n] 2nd try: Re-organize -fvect-cost-model, enable basic vectorization at -O2

2013-08-28 Thread Xinliang David Li
On Wed, Aug 28, 2013 at 12:59 AM, Richard Biener wrote: > On Tue, 27 Aug 2013, Xinliang David Li wrote: > >> Richard, I have some comments about the patch. >> >> > -ftree-vectorizer-verbose=This switch is deprecated. Use >> > -fopt-info inst

Re: opt-info message change for vectorizer

2013-08-28 Thread Xinliang David Li
asic3.c:8:foo: note: loop with 7 iterations completely unrolled basic3.c:5:foo: note: loop with 7 iterations completely unrolled Is this version ok after testing? thanks, David On Wed, Aug 28, 2013 at 2:45 AM, Richard Biener wrote: > On Tue, Aug 27, 2013 at 10:30 PM, Xinliang David Li

Eliminate vectorizer analysis side effects

2013-08-29 Thread Xinliang David Li
02088) +++ ChangeLog (working copy) @@ -1,5 +1,17 @@ 2013-08-29 Xinliang David Li + * tree-vect-data-refs.c (vect_compute_data_ref_alignment): + Delay base decl alignment adjustment. + * tree-vectorizer.c (ensure_base_alignment): New function. + (vectorize_loops): Add dbg_cnt su

Re: [Google] Refine hot caller heuristic

2013-08-29 Thread Xinliang David Li
20, 2013 at 9:35 PM, Xinliang David Li wrote: >> Do you need to guard the jump function access with check if >> (ipa_node_params_vector.exists ())? > I believe it is not necessary since, for example, ipa_analyze_node > calls ipa_check_create_node_params that calls create. But I se

Re: [PATCH] Convert more passes to new dump framework

2013-08-30 Thread Xinliang David Li
Except that in this form, the dump will be extremely large and not suitable for very large applications. Besides, we might also want to use the same machinery (dump_printf_loc etc) for dump file dumping. The current behavior of using '-details' to turn on opt-info-all messages for dump files are no

Re: [PATCH] Convert more passes to new dump framework

2013-08-30 Thread Xinliang David Li
On Fri, Aug 30, 2013 at 12:51 PM, Teresa Johnson wrote: > On Fri, Aug 30, 2013 at 9:27 AM, Xinliang David Li wrote: >> Except that in this form, the dump will be extremely large and not >> suitable for very large applications. > > Yes. I did some measurements for both a fai

Re: Eliminate vectorizer analysis side effects

2013-08-30 Thread Xinliang David Li
On Fri, Aug 30, 2013 at 1:23 AM, Richard Biener wrote: > On Fri, Aug 30, 2013 at 1:28 AM, Xinliang David Li wrote: >> I was debugging a runtime failure of SPEC06 xalancbmk built with LIPO. >> Using -fdisable- option pinpoints the problem in slp vectorize >> pass on a partic

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

2013-09-01 Thread Xinliang David Li
Missing test cases? Have you tested the optimization with SPEC2k and SPEC06? There are a couple of benchmarks benefit greatly from devirtualization, such as eon, povray etc. I believe astar will probably improve with this optimization at O2 (it has hot virtual functions that are not overridden a

Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.

2013-09-03 Thread Xinliang David Li
>From Joseph: "The conversion is not safe for sqrt if the two types are double and long double and long double is x86 extended, for example." This is not reflected in the patch. David On Tue, Sep 3, 2013 at 2:27 PM, Joseph S. Myers wrote: > On Tue, 3 Sep 2013, Cong Hou wrote: > >> + CASE_MAT

Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.

2013-09-04 Thread Xinliang David Li
On Wed, Sep 4, 2013 at 1:53 PM, Cong Hou wrote: > I have made a new patch according to your comments. I found several > references saying that the precision 2p+2 is OK for the sqrt > conversion (one here: > http://www.cs.berkeley.edu/~fateman/generic/algorithms.pdf). The new > patch is pasted as b

Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.

2013-09-04 Thread Xinliang David Li
On Wed, Sep 4, 2013 at 1:59 PM, Joseph S. Myers wrote: > On Wed, 4 Sep 2013, Cong Hou wrote: > >> I have made a new patch according to your comments. I found several >> references saying that the precision 2p+2 is OK for the sqrt >> conversion (one here: >> http://www.cs.berkeley.edu/~fateman/gene

Re: [PATCH] Fixing improper conversion from sin() to sinf() in optimization mode.

2013-09-09 Thread Xinliang David Li
+ >/* Be careful about integer to fp conversions. > These may overflow still. */ >if (FLOAT_TYPE_P (TREE_TYPE (arg0)) > Index: gcc/testsuite/gcc.c-torture/execute/20030125-1.c > ======= > --- gcc/t

Re: Dump framework newline cleanup

2013-09-09 Thread Xinliang David Li
looks fine to me. In the long run, I wonder if the machinery in diagnostic messages can be reused for opt-info dumping -- i.e., support different streams. It has many nice features including %qD specifier for printing tree decls. David On Mon, Sep 9, 2013 at 12:01 PM, Teresa Johnson wrote: > I'

[google] record system paths (isystem) in module infos (LIPO mode)

2013-09-10 Thread Xinliang David Li
The following patch enables GCC to record system include paths in module infos. This allows more precise parsing context to be established when compiling auxiliary modules -- FE behaves slightly differently when parsing system headers. There are also a couple of other cleanups in the patch. David

Re: [PATCH] [vectorizer] Fixing a bug in tree-vect-patterns.c in GCC vectorizer.

2013-09-11 Thread Xinliang David Li
Can you add a test case to the regression suite? When the type of arguments are unsigned short/unsigned int, GCC does not vectorize the loop anymore -- this is worth a separate bug to track. punpcklwd instruction can be used to do zero extension of the short type. David On Wed, Sep 11, 2013 at 6

Re: [Google] Fix test failure after porting __gcov_get_profile_prefix from google/4_7

2013-09-12 Thread Xinliang David Li
On Thu, Sep 12, 2013 at 1:06 PM, Teresa Johnson wrote: > After porting r198033 from google/4_7 to google/4_8 a test case failed > with an assert when trying to take the strlen of profile_data_prefix. > > In most cases this is either set from the directory specified to > -fprofile-generate=, or to

New GCC options for loop vectorization

2013-09-12 Thread Xinliang David Li
{ loop->force_vect = true; Index: ChangeLog === --- ChangeLog (revision 202481) +++ ChangeLog (working copy) @@ -1,3 +1,24 @@ +2013-09-12 Xinliang David Li + + * tree-if-conv.c (main_tree_if_conversio

Re: [Google] Fix test failure after porting __gcov_get_profile_prefix from google/4_7

2013-09-12 Thread Xinliang David Li
: > On Thu, Sep 12, 2013 at 1:20 PM, Xinliang David Li wrote: >> On Thu, Sep 12, 2013 at 1:06 PM, Teresa Johnson wrote: >>> After porting r198033 from google/4_7 to google/4_8 a test case failed >>> with an assert when trying to take the strlen of profile_data_prefix. &g

Re: [Google] Fix test failure after porting __gcov_get_profile_prefix from google/4_7

2013-09-13 Thread Xinliang David Li
Ok. David On Fri, Sep 13, 2013 at 7:21 AM, Teresa Johnson wrote: > Testing passes, is the below patch ok for google/4_8? > Thanks, Teresa > > On Thu, Sep 12, 2013 at 10:18 PM, Teresa Johnson wrote: >> On Thu, Sep 12, 2013 at 2:32 PM, Xinliang David Li >> wrote: &

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener wrote: > On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li > wrote: >> Currently -ftree-vectorize turns on both loop and slp vectorizations, >> but there is no simple way to turn on loop vectorization alone. The >> logi

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
, Xinliang David Li wrote: > On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener > wrote: >> On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li >> wrote: >>> Currently -ftree-vectorize turns on both loop and slp vectorizations, >>> but there is no simple way to t

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
Ok -- then my updated patch is wrong then. The implementation in the first version matches the requirement. thanks, David On Fri, Sep 13, 2013 at 9:45 AM, Joseph S. Myers wrote: > On Fri, 13 Sep 2013, Richard Biener wrote: > >> @@ -1691,6 +1695,12 @@ common_handle_option (struct gcc_options >>

Re: New GCC options for loop vectorization

2013-09-13 Thread Xinliang David Li
Updated patch implementing the logic that more specific option wins. Ok for trunk? thanks, David On Fri, Sep 13, 2013 at 9:48 AM, Xinliang David Li wrote: > Ok -- then my updated patch is wrong then. The implementation in the > first version matches the requirement. > > thank

tree if convert pass control

2013-09-13 Thread Xinliang David Li
revision 202229) +++ ChangeLog (working copy) @@ -1,3 +1,12 @@ +2013-09-13 Xinliang David Li + + * omp-low.c (expand_omp_simd): Build optimization cl + node if necessary. + * opts.c (finish_option): Enable/Disable tree if-cvt + if not explicitly set. +

Re: Dump framework newline cleanup

2013-09-16 Thread Xinliang David Li
I noticed there are a couple of dump_printf_loc instances in coverage.c not ended with newline. They should be fixed. David On Tue, Sep 10, 2013 at 6:32 AM, Teresa Johnson wrote: > On Mon, Sep 9, 2013 at 9:55 PM, Xinliang David Li wrote: >> looks fine to me. >> >> In the

Re: Dump framework newline cleanup

2013-09-16 Thread Xinliang David Li
ize without a profile. thanks, David On Mon, Sep 16, 2013 at 11:06 AM, Teresa Johnson wrote: > On Mon, Sep 16, 2013 at 10:57 AM, Xinliang David Li > wrote: >> I noticed there are a couple of dump_printf_loc instances in >> coverage.c not ended with newline. They should be

Re: New GCC options for loop vectorization

2013-09-16 Thread Xinliang David Li
I incorporated all the comments and committed the change (also fixed a test failure with --help=optimizers). thanks, David On Mon, Sep 16, 2013 at 3:07 AM, Richard Biener wrote: > On Fri, Sep 13, 2013 at 6:56 PM, Xinliang David Li wrote: >> Updated patch implementing the logic

Re: New GCC options for loop vectorization

2013-09-16 Thread Xinliang David Li
On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener wrote: > On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li wrote: >> On Fri, Sep 13, 2013 at 1:30 AM, Richard Biener >> wrote: >>> On Thu, Sep 12, 2013 at 10:31 PM, Xinliang David Li >>> wrote: >>>>

Re: tree if convert pass control

2013-09-16 Thread Xinliang David Li
Ok -- abandon the patch. On Mon, Sep 16, 2013 at 2:04 AM, Richard Biener wrote: > On Sat, Sep 14, 2013 at 8:10 AM, Xinliang David Li wrote: >> tree if conversion is an enabler pass for vectorization, so by >> default, it is only turned on when vectorization is on, but may also &

Re: New GCC options for loop vectorization

2013-09-17 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 1:20 AM, Richard Biener wrote: > On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li > wrote: >> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >> wrote: >>> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >>> wrote: >>&

Re: New GCC options for loop vectorization

2013-09-17 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 8:45 AM, Jakub Jelinek wrote: > On Tue, Sep 17, 2013 at 08:37:57AM -0700, Xinliang David Li wrote: >> >> char a[1]; >> >> >> >> void foo(int n) >> >> { >> >> int* b = (int*)(a+n); >

Re: [GOOGLE] AutoFDO should honor system paths in the profile

2013-09-17 Thread Xinliang David Li
ok. David On Tue, Sep 17, 2013 at 4:53 PM, Dehao Chen wrote: > This patch makes AutoFDO honor system paths stored in the profile. > > Bootstrapped and passed regression tests. > > OK for google-4_8 branch? > > Thanks, > Dehao > > Index: gcc/auto-profile.c > ==

Re: [GOOGLE] disable slp for AutoFDO

2013-09-18 Thread Xinliang David Li
Ok. David On Wed, Sep 18, 2013 at 10:21 AM, Dehao Chen wrote: > This patch disables SLP for AutoFDO. > > Bootstrapped and passed unittests. > > OK for google-4_8? > > Thanks, > Dehao > > Index: gcc/opts.c > === > --- gcc/opts.c (rev

Re: New GCC options for loop vectorization

2013-09-18 Thread Xinliang David Li
On Tue, Sep 17, 2013 at 1:20 AM, Richard Biener wrote: > On Mon, Sep 16, 2013 at 10:24 PM, Xinliang David Li > wrote: >> On Mon, Sep 16, 2013 at 3:13 AM, Richard Biener >> wrote: >>> On Fri, Sep 13, 2013 at 5:16 PM, Xinliang David Li >>> wrote: >>&

Re: [GOOGLE] Patch to fix AutoFDO LIPO performance regression

2013-09-18 Thread Xinliang David Li
On Wed, Sep 18, 2013 at 4:51 PM, Dehao Chen wrote: > This patch fixup the call graph edge targets during AutoFDO pass, so > that when rebuilding call graph edges, it can find the correct callee. > > Bootstrapped and passed regression test. Benchmark tests on-going. > > Ok for google-4_8 branch? >

Re: [GOOGLE] Patch to fix AutoFDO LIPO performance regression

2013-09-19 Thread Xinliang David Li
/* Local pure-const may imply need to fixup the cfg. */ > + if (execute_fixup_cfg () & TODO_cleanup_cfg) > + cleanup_tree_cfg (); > + >current_function_decl = NULL; >pop_cfun (); > } > > - cgraph_pre_profiling_inlining_done = true; > -

Re: [GOOGLE] Sets cgraph_node count during annotation

2013-09-19 Thread Xinliang David Li
Looks good. David On Thu, Sep 19, 2013 at 1:15 PM, Dehao Chen wrote: > This patch sets cgraph_node count during AutoFDO annotation, otherwise > execute_fixup_cfg will clear all the BB counts. > > bootstrapped and passed regression test. > > OK for google-4_8 branch? > > Thanks, > Dehao > > Index

Re: [GOOGLE] Patch to fix AutoFDO LIPO performance regression

2013-09-19 Thread Xinliang David Li
e_profiling_inlining_done = true; > - cgraph_process_module_scope_statics (); > - /* Now perform link to allow cross module inlining. */ > - cgraph_do_link (); > - varpool_do_link (); > - cgraph_unify_type_alias_sets (); > - >return TODO_rebuild_cgraph_edges; > } &

Re: [GOOGLE] Patch to fix AutoFDO LIPO performance regression

2013-09-20 Thread Xinliang David Li
cleanup are moved after > annotation. So setting of cgraph node's count is still needed, right? > > Thanks, > Dehao > > On Thu, Sep 19, 2013 at 9:28 PM, Xinliang David Li wrote: >> I did not catch this in the last review. The cleanup CFG should be >> done be

Re: Revisit Core tunning flags

2013-09-21 Thread Xinliang David Li
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 > > It makes CORE tuning to more follow the optimization guidelines. > In particular it removes some tuning flags for features I imple

Re: Revisit Core tunning flags

2013-09-21 Thread Xinliang David Li
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 >> >> It makes CORE tuning to more f

Re: New GCC options for loop vectorization

2013-09-23 Thread Xinliang David Li
Thanks. I modified the patch so that the max allowed peel iterations can be specified via a parameter. Testing on going. Ok for trunk ? David On Mon, Sep 23, 2013 at 4:31 AM, Richard Biener wrote: > On Wed, Sep 18, 2013 at 10:21 PM, Xinliang David Li > wrote: >> On Tue, Sep 17,

Re: [PATCH] Bug fix: *var and MEM[(const int *)var] (var has int* type) are not treated as the same data ref.

2013-09-23 Thread Xinliang David Li
Basically GCC reports that the loop is vectorized, but the vectorized loop is never executed because of the bogus alias check ' a + 16 < a' generated. In trunk, the vectorized version is eliminated, but it remains as a dead code with gcc 48. David On Mon, Sep 23, 2013 at 5:26 PM, Cong Hou wrote:

Re: [GOOGLE] Disable aggressive loop peeling to prevent code bloat.

2013-09-25 Thread Xinliang David Li
I wish there is better heuristic in the future. For now it is ok. David On Wed, Sep 25, 2013 at 2:48 PM, Dehao Chen wrote: > This patch disables aggressive loop peeling when profile is available. > This prevents extensive code bloat which leads to increased i-cache > misses. > > Bootstrapped and

cost model patch

2013-09-25 Thread Xinliang David Li
I took the liberty to pick up Richard's original fvect-cost-model patch and made some modification. What has not changed: 1) option -ftree-vect-loop-version is removed; 2) three cost models are introduced: cheap, dynamic, and unlimited; 3) unless explicitly specified, cheap model is the default at

Re: [GOOGLE] max-lipo-group parameter for AutoFDO

2013-09-26 Thread Xinliang David Li
Looks ok. David On Thu, Sep 26, 2013 at 9:00 AM, Dehao Chen wrote: > This patch fix the bug when setting max-lipo-group in AutoFDO: > > Bootstrapped and passed regression test. > > OK for google branches? > > Thanks, > Dehao > > Index: gcc/auto-profile.c > ===

Re: [GOOGLE] Fix an ICE in lipo_cmp_type

2013-09-26 Thread Xinliang David Li
yes. David On Thu, Sep 26, 2013 at 9:26 AM, Dehao Chen wrote: > This fixes an ICE when lipo_cmp_type handles NULL_PTR_TYPE. > > Bootstrapped and regression test on going? > > OK for google branches? > > Thanks, > Dehao > > Index: gcc/l-ipo.c >

Re: cost model patch

2013-09-26 Thread Xinliang David Li
On Thu, Sep 26, 2013 at 7:37 AM, Richard Biener wrote: > On Thu, Sep 26, 2013 at 1:10 AM, Xinliang David Li wrote: >> I took the liberty to pick up Richard's original fvect-cost-model >> patch and made some modification. >> >> What has not changed: >>

Re: [google gcc-4_8] alternate hirate for builtin_expert

2013-09-26 Thread Xinliang David Li
This patch improves linux kernel performance with a large workload, so it is good to first submit this to trunk and backport it. thanks, David On Thu, Sep 26, 2013 at 3:27 PM, Jan Hubicka wrote: >> Hi, >> >> Current default probably for builtin_expect is 0.9996. >> This makes the freq of unlike

Re: [google gcc-4_8] alternate hirate for builtin_expert

2013-09-26 Thread Xinliang David Li
it might worth extend __builtin_expect to take more parameters: 1) argument to specify actual probability: __builtin_expect (x, 10, 0.6) 2) a more general way of doing this is to allow specifying multiple values, and the probability is determined by # of occurances: __builtin_expect (x, 10, 10, 20)

Re: Add value range support into memcpy/memset expansion

2013-09-27 Thread Xinliang David Li
Nice extension. Test cases would be great to have. thanks, David On Fri, Sep 27, 2013 at 7:50 AM, Jan Hubicka wrote: > Hi, > this patch makes it possible to access value range info from setmem/movstr > that > I plan to use in i386 memcpy/memset expansion code. It is all quite > straighforward

Re: cost model patch

2013-09-27 Thread Xinliang David Li
turned on at -O2. To override this, use option -fvect-cost-model=[cheap|dynamic|unlimited]. New Languages and Language specific improvements thanks, David On Thu, Sep 26, 2013 at 11:09 AM, Xinliang David Li wrote: > On Thu, Sep 26, 2013 at 7:37 AM, Richard Biener > wrote: >>

Re: [google/4_8] Disable -g/-gmlt during LIPO instrumentation

2013-09-27 Thread Xinliang David Li
On Fri, Sep 27, 2013 at 11:50 AM, Teresa Johnson wrote: > David and Rong, > > The following patch will disable -g/-gmlt when instrumenting for LIPO > since they will affect the recorded ggc_memory used in the module > grouping decision. Added -fripa-allow-debug to override this behavior. > > Passe

Re: [google/4_8] Disable -g/-gmlt during LIPO instrumentation

2013-09-27 Thread Xinliang David Li
ok. David On Fri, Sep 27, 2013 at 1:03 PM, Teresa Johnson wrote: > On Fri, Sep 27, 2013 at 12:01 PM, Xinliang David Li > wrote: >> On Fri, Sep 27, 2013 at 11:50 AM, Teresa Johnson >> wrote: >>> David and Rong, >>> >>> The following patch will

Re: [google/4_8] Disable -g/-gmlt during LIPO instrumentation

2013-09-27 Thread Xinliang David Li
The key is that grouping results should not dependent on the presence of -g flags. The downside of the patch is that it may slightly underestimate the memory pressure at profile-use time, but that should not be a big problem. David On Fri, Sep 27, 2013 at 1:18 PM, Rong Xu wrote: > I don't quite

Re: [Google] Adjust comdat-sharing-probability param for -Os

2013-09-27 Thread Xinliang David Li
d.growth -= (info->size * (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY)) + 50) / 100; What is the purpose of '50' here? The patch is fine for Google branch. Other tunings to think about -- I think the sharing probability should not be a fixed value -- but depending on the functio

Re: [PATCH] Relax the requirement of reduction pattern in GCC vectorizer.

2013-09-28 Thread Xinliang David Li
You can also add a test case of this form: int foo( int t, int n, int *dst) { int j = 0; int s = 1; t++; for (j = 0; j < n; j++) { dst[j] = t; s *= t; } return s; } where without the fix the loop vectorization is missed. David On Fri, Sep 27, 2013 at

Re: Add value range support into memcpy/memset expansion

2013-09-28 Thread Xinliang David Li
On Sat, Sep 28, 2013 at 3:05 PM, Jan Hubicka wrote: >> > Nice extension. Test cases would be great to have. >> Fore those you need i386 changes to actually use the info. I will post that >> after some cleanup and additional testing. > > Hi, > since I already caught your attention, here is the tar

Re: cost model patch

2013-09-30 Thread Xinliang David Li
Yes, that will do. Can you do it for me? I can't do testing easily on arm myself. thanks, David On Mon, Sep 30, 2013 at 3:29 AM, Kyrill Tkachov wrote: > Hi Richard, David, > >> In principle yes. Note that it changes the behavior of -O2 >> -ftree-vectorize >> as -ftree-vectorize does not i

Re: [PATCH] Improving uniform_vector_p() function.

2013-10-01 Thread Xinliang David Li
On Tue, Oct 1, 2013 at 10:31 AM, Cong Hou wrote: > The current uniform_vector_p() function only returns non-NULL when the > vector is directly a uniform vector. For example, for the following > gimple code: > > vect_cst_.15_91 = {_9, _9, _9, _9, _9, _9, _9, _9}; > > > The current implementation ca

Re: [PATCH] Improving uniform_vector_p() function.

2013-10-01 Thread Xinliang David Li
On Tue, Oct 1, 2013 at 2:37 PM, Xinliang David Li wrote: > On Tue, Oct 1, 2013 at 10:31 AM, Cong Hou wrote: >> The current uniform_vector_p() function only returns non-NULL when the >> vector is directly a uniform vector. For example, for the following >> gimple code: >&g

Re: [google 4.7] fix line number checksum mismatch in lipo-use (issue6566044)

2012-09-28 Thread Xinliang David Li
ok (for google-47 and google/main) thanks, David On Fri, Sep 28, 2012 at 10:22 AM, Rong Xu wrote: > Comments are inlined. > Attached is the new patch. > > Thanks, > > -Rong > > On Tue, Sep 25, 2012 at 2:25 PM, Xinliang David Li wrote: >> On Mon, Sep 24, 2012 at 2

Re: [PATCH] Fix powerpc breakage, was: Add option for dumping to stderr (issue6190057)

2012-10-01 Thread Xinliang David Li
On Mon, Oct 1, 2012 at 2:37 PM, Michael Meissner wrote: > I tracked down some of the other code that previously used REPORT_DETAILS, and > MSG_NOTE is the new way to do the same thing. This bootstraps and no > unexpected errors occur during make check. Is it ok to install? > > 2012-10-01 Michae

Re: [PATCH] Fix powerpc breakage, was: Add option for dumping to stderr (issue6190057)

2012-10-01 Thread Xinliang David Li
sier to read/maintain. > I find it confusing to be honest. The redundant check serves no purpose. David > Sharad > Sharad > > > On Mon, Oct 1, 2012 at 3:45 PM, Xinliang David Li wrote: >> On Mon, Oct 1, 2012 at 2:37 PM, Michael Meissner >> wrote: >>> I tracked

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Xinliang David Li
What is the status of switch expansion GIMPLE rewrite? If it is not planned for 4.8, It will be desirable to include this fix into trunk. It also helps set up a good base line to test against regression. thanks, David On Tue, Oct 2, 2012 at 6:09 PM, Easwaran Raman wrote: > Hi, > This patch pr

Re: Propagate profile counts during switch expansion

2012-10-03 Thread Xinliang David Li
thanks for the update! David On Wed, Oct 3, 2012 at 10:37 AM, Steven Bosscher wrote: > On Wed, Oct 3, 2012 at 6:12 PM, Xinliang David Li wrote: >> What is the status of switch expansion GIMPLE rewrite? If it is not >> planned for 4.8, It will be desirable to include this fix in

Re: User directed Function Multiversioning via Function Overloading (issue5752064)

2012-10-05 Thread Xinliang David Li
Hi Jason, Sri has addressed the comments you had on FE part. Can you take a look if it is ok? Stage-1 is going to be closed soon, and we hope to get this major feature in 4.8. thanks, David On Tue, Sep 18, 2012 at 9:29 AM, Sriraman Tallam wrote: > Ping. > > On Fri, Aug 24, 2012 at 5:34 PM,

Re: [google] AutoFDO implementation

2012-10-05 Thread Xinliang David Li
thanks. That will be helpful. David On Fri, Oct 5, 2012 at 2:09 PM, Dehao Chen wrote: > Sure, I'll add a detailed documentation in a gcc wiki page. > > Dehao > > On Fri, Oct 5, 2012 at 2:01 PM, Xinliang David Li wrote: >> Dehao, the file auto-profile.c has some

Re: [google] Emit relative addresses to function patch sections instead of absolute addresses. (issue6572065)

2012-10-06 Thread Xinliang David Li
xray feature is not in trunk yet. David On Fri, Oct 5, 2012 at 3:53 PM, Diego Novillo wrote: > Harshit, why didn't you propose this patch for trunk? Why should we > make it a google-local patch? > > > Diego. > > On Fri, Sep 28, 2012 at 5:24 AM, Harshit Chopra wrote: >> commit fc3a55ccec9bc770c

Re: [google] Emit relative addresses to function patch sections instead of absolute addresses. (issue6572065)

2012-10-06 Thread Xinliang David Li
Ok for google branches. Please consider resend the original xray patch to trunk (gcc-4_8) You need to make the runtime bits available publicly though. thanks, David On Fri, Sep 28, 2012 at 2:24 AM, Harshit Chopra wrote: > commit fc3a55ccec9bc770c79f8a221f5abd397befc8f6 > Author: Harshit Chopra

Re: [asan] New transitional branch to port ASAN to trunk

2012-10-10 Thread Xinliang David Li
Is there an agreed way for file naming? David On Wed, Oct 10, 2012 at 1:48 PM, Steven Bosscher wrote: > On Wed, Oct 10, 2012 at 10:20 PM, Diego Novillo wrote: >> * tree-asan.c: New file. >> * tree-asan.h: New file. > > Nit: do we still need the "tree-" prefix? IMHO not. > > Ciao!

Re: [asan] New transitional branch to port ASAN to trunk

2012-10-10 Thread Xinliang David Li
On Wed, Oct 10, 2012 at 2:08 PM, Steven Bosscher wrote: > On Wed, Oct 10, 2012 at 11:00 PM, Xinliang David Li wrote: >> Is there an agreed way for file naming? > > It was not my intent to start a bike shed discussion. This was just > something I've been wondering for some

Re: Use conditional casting with symtab_node

2012-10-10 Thread Xinliang David Li
In a different thread, I proposed the following alternative to 'try_xxx': template T* symbol::cast_to(symbol* p) { if (p->is()) return static_cast(p); return 0; } cast: template T& symbol:as(symbol* p) { assert(p->is()) return static_cast(*p); } David On Wed, Sep 19, 2012

Re: Use conditional casting with symtab_node

2012-10-10 Thread Xinliang David Li
On Wed, Sep 19, 2012 at 11:39 AM, Lawrence Crowl wrote: > On 9/19/12, Gabriel Dos Reis wrote: >> On Sep 19, 2012 Richard Guenther wrote: >> > Indeed. Btw, can we not provide a specialization for >> > dynamic_cast <>? This ->try_... looks awkward to me compared >> > to the more familiar >> > >>

Re: Use conditional casting with symtab_node

2012-10-10 Thread Xinliang David Li
On Fri, Oct 5, 2012 at 1:49 AM, Richard Guenther wrote: > On Thu, Oct 4, 2012 at 8:16 PM, Diego Novillo wrote: >> On Thu, Oct 4, 2012 at 2:14 PM, Lawrence Crowl wrote: >> >>> So, Jan Hubicka requested and approved the current spelling. >>> What now? >> >> I don't think we should hold this up. T

Re: Move statements upwards after reassociation

2012-10-10 Thread Xinliang David Li
On Wed, Oct 10, 2012 at 6:52 PM, Easwaran Raman wrote: > Hi, > In the expression reassociation pass, statements might get moved > downwards to ensure that dependences are not violated after > reassociation. This can increase the live range and, in a tight loop, > result in spills. This patch sim

Re: Move statements upwards after reassociation

2012-10-11 Thread Xinliang David Li
On Thu, Oct 11, 2012 at 6:16 AM, Richard Biener wrote: > On Thu, Oct 11, 2012 at 3:52 AM, Easwaran Raman wrote: >> Hi, >> In the expression reassociation pass, statements might get moved >> downwards to ensure that dependences are not violated after >> reassociation. This can increase the live r

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-11 Thread Xinliang David Li
On Thu, Oct 11, 2012 at 9:38 AM, Jakub Jelinek wrote: > Hi! > > Building trees, then gimplifying it, is unnecessarily expensive. > This patch changes build_check_stmt to emit GIMPLE directly, and > a couple of small cleanups here and there. Also, I'm using a different > alias set for the shadow m

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-11 Thread Xinliang David Li
On Thu, Oct 11, 2012 at 11:12 AM, Jakub Jelinek wrote: > On Thu, Oct 11, 2012 at 10:31:58AM -0700, Xinliang David Li wrote: >> > +#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 2000 - 1) >> > +#define PROB_ALWAYS(REG_BR_PROB_BASE) >> > + >>

Re: Use conditional casting with symtab_node

2012-10-11 Thread Xinliang David Li
On Thu, Oct 11, 2012 at 1:23 PM, Lawrence Crowl wrote: > On 10/10/12, Xinliang David Li wrote: >> In a different thread, I proposed the following alternative to 'try_xxx': >> >> template T* symbol::cast_to(symbol* p) { >>if (p->is()) >&g

Re: [google] Move delete with size to its own file (issue6655052)

2012-10-11 Thread Xinliang David Li
ok. thanks, David On Thu, Oct 11, 2012 at 1:21 PM, Easwaran Raman wrote: > This patch moves the two argument delete operator into its own file. > When a program provides its own definition of operator delete (void > *), but not operator delete (void *, size_t), we could end up linking > two fil

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 12:15 AM, Jakub Jelinek wrote: > On Thu, Oct 11, 2012 at 04:19:18PM -0700, Wei Mi wrote: >> Here is the initial test results of gcc asan patch, and it shows us >> some missing features in gcc but existing in llvm. >> [1]. gcc regression test for gcc-asan passes. >> [2]. llv

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 9:32 AM, Jakub Jelinek wrote: > On Fri, Oct 12, 2012 at 09:30:33AM -0700, Xinliang David Li wrote: >> > Yeah, I think the stack check shouldn't be that hard and can hack it up, >> > I'll perhaps leave the global vars stuff to Dodji or others

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 12:26 AM, Jakub Jelinek wrote: > On Thu, Oct 11, 2012 at 10:05:54PM -0700, Xinliang David Li wrote: >> Was: >> Type global; >> Now: >> struct { // at least 32-byte aligned >>Type orig; >>char redzone[32 + r

Re: [asan] Protection of stack vars

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 9:27 AM, Jakub Jelinek wrote: > Hi! > > This is not finished completely yet, but roughly implements protection > of stack variables. As testcase I was using: > extern void *malloc (__SIZE_TYPE__); > > int > main () > { > char buf1[16]; > char buf2[256]; > char buf3[3

Re: [asan] Protection of stack vars

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 11:10 AM, Jakub Jelinek wrote: > On Fri, Oct 12, 2012 at 10:52:04AM -0700, Xinliang David Li wrote: >> This is related to the way how you implement it. Emitting the stack >> shadow initialization code in GIMPLE would solve the problem. I think >>

Re: Use conditional casting with symtab_node

2012-10-12 Thread Xinliang David Li
On Fri, Oct 12, 2012 at 1:22 AM, Richard Biener wrote: > On Thu, Oct 11, 2012 at 10:39 PM, Xinliang David Li > wrote: >> On Thu, Oct 11, 2012 at 1:23 PM, Lawrence Crowl wrote: >>> On 10/10/12, Xinliang David Li wrote: >>>> In a different thread, I prop

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-15 Thread Xinliang David Li
, it is in the wishlist: http://code.google.com/p/address-sanitizer/issues/detail?id=83 Might be good consider this feature. David On Fri, Oct 12, 2012 at 9:30 AM, Xinliang David Li wrote: > On Fri, Oct 12, 2012 at 12:15 AM, Jakub Jelinek wrote: >> On Thu, Oct 11, 2012 at 04:19:18PM

Re: [PATCH] Reduce conservativeness in REE using machine model (issue6631066)

2012-10-15 Thread Xinliang David Li
The change to remove mode check looks good to me. Not directly related to this bug but somehow related: the REE has obvious conservativeness regarding partial redundancy (i.e., not all reaching def has the bits properly extended). However, there are bugs preventing elimination even with full redu

Re: [asan] Emit GIMPLE directly, small cleanups

2012-10-16 Thread Xinliang David Li
On Mon, Oct 15, 2012 at 11:12 PM, Jakub Jelinek wrote: > On Mon, Oct 15, 2012 at 10:48:13PM -0700, Xinliang David Li wrote: >> Another error checking feature is to poison stack vars on entry and >> exit of the lexical scope to catch uninit variable reference and out >>

  1   2   3   4   5   6   7   8   9   10   >