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

2013-08-20 Thread Cong Hou
When a sin() (cos(), log(), etc.) function is called on a value of float type and the returned double value is converted to another value of float type, GCC converts this function call into a float version (sinf()) in the optimization mode. This avoids two type conversions and the float version fun

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

2013-09-03 Thread Cong Hou
te/20030125-1.c (working copy) @@ -44,11 +44,11 @@ __attribute__ ((noinline)) double sin(double a) { - abort (); + return a; } __attribute__ ((noinline)) float sinf(float a) { - return a; + abort (); } On Sat, Aug 31, 2013 at 9:24 AM, Joseph S. Myers wrote: > On Sat, 31 Aug 2013, Cong Hou

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

2013-09-03 Thread Cong Hou
Could you please tell me how to check the precision of long double in GCC on different platforms? Thank you! Cong On Tue, Sep 3, 2013 at 2:43 PM, Joseph S. Myers wrote: > On Tue, 3 Sep 2013, Xinliang David Li wrote: > >> >From Joseph: >> >> "The >> conversion is not safe for sqrt if the two ty

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

2013-09-04 Thread Cong Hou
+ CASE_MATHFN (FABS) + CASE_MATHFN (LOGB) #undef CASE_MATHFN { tree arg0 = strip_float_extensions (CALL_EXPR_ARG (expr, 0)); On Tue, Sep 3, 2013 at 3:38 PM, Joseph S. Myers wrote: > On Tue, 3 Sep 2013, Cong Hou wrote: > >> Could you please tell me how to check the precisi

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

2013-09-04 Thread Cong Hou
(double a) { - abort (); + return a; } __attribute__ ((noinline)) float sinf(float a) { - return a; + abort (); } On Wed, Sep 4, 2013 at 2:21 PM, Xinliang David Li wrote: > On Wed, Sep 4, 2013 at 1:59 PM, Joseph S. Myers > wrote: >> On Wed, 4 Sep 2013, Cong Hou wrote: >> &

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

2013-09-06 Thread Cong Hou
First, thank you for your detailed comments again! Then I deeply apologize for not explaining my patch properly and responding to your previous comment. I didn't understand thoroughly the problem before submitting the patch. Previously I only considered the following three conversions for sqrt():

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

2013-09-09 Thread Cong Hou
On Mon, Sep 9, 2013 at 6:26 PM, Xinliang David Li wrote: > On Fri, Sep 6, 2013 at 3:24 PM, Cong Hou wrote: >> First, thank you for your detailed comments again! Then I deeply >> apologize for not explaining my patch properly and responding to your >> previous comment

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

2013-09-11 Thread Cong Hou
Hi There is a bug in the function vect_recog_dot_prod_pattern() in tree-vect-patterns.c. This function checks if a loop is of dot production pattern. Specifically, according to the comment of this function: /* Try to find the following pattern: type x_t, y_t; TYPE1 prod; TYPE2 su

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

2013-09-13 Thread Cong Hou
1, &def_stmt, &promotion) || !promotion) return NULL; Index: gcc/ChangeLog === --- gcc/ChangeLog (revision 202572) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,9 @@ +

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

2013-09-20 Thread Cong Hou
Any comment or more suggestions on this patch? thanks, Cong On Mon, Sep 9, 2013 at 7:28 PM, Cong Hou wrote: > On Mon, Sep 9, 2013 at 6:26 PM, Xinliang David Li wrote: >> On Fri, Sep 6, 2013 at 3:24 PM, Cong Hou wrote: >>> First, thank you for your detailed comments ag

[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 Cong Hou
(I have also created this issue in bug reports: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58513) First look at the code below: int op(const int* a, const int* b) { return *a+*b; } void foo(int*a, int b) { int i; for (i = 0; i < 10; ++i) a[i] = op(a+i, &b); } GCC will generate t

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

2013-09-24 Thread Cong Hou
i! >> > >> > On Mon, Sep 23, 2013 at 05:26:13PM -0700, Cong Hou wrote: >> > >> > Missing ChangeLog entry. >> > >> > > --- gcc/testsuite/gcc.dg/alias-14.c (revision 0) >> > > +++ gcc/testsuite/gcc.dg/alias-14.c (revision 0) >>

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

2013-09-27 Thread Cong Hou
a2 > a2 = operation (a3, a1) A test case is also added. The patch is tested on x86-64. thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39c786e..45c1667 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-09-27 Cong Hou + + * t

[PATCH] Improving uniform_vector_p() function.

2013-10-01 Thread Cong Hou
-10-01 Cong Hou + + * tree.c: Improve the function uniform_vector_p() so that a + vector assigned with a uniform vector is also treated as a + uniform vector. + diff --git a/gcc/tree.c b/gcc/tree.c index 1c881e4..1d6d894 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -10297,6

Re: [PATCH] Improving uniform_vector_p() function.

2013-10-01 Thread Cong Hou
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: >> >> vect_cst_.15_91 = {_9, _9, _9, _9, _9,

[PATCH] Reducing number of alias checks in vectorization.

2013-10-01 Thread Cong Hou
le_nop_p (def) +|| !flow_bb_inside_loop_p (loop, gimple_bb (def))) + continue; + } + hoist = false; + break; +} + +if (hoist) +{ + basic_block preheader = loop_preheader_edge (loop)->src; + gimple_stmt

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-02 Thread Cong Hou
On Tue, Oct 1, 2013 at 11:35 PM, Jakub Jelinek wrote: > On Tue, Oct 01, 2013 at 07:12:54PM -0700, Cong Hou wrote: >> --- gcc/tree-vect-loop-manip.c (revision 202662) >> +++ gcc/tree-vect-loop-manip.c (working copy) > > Your mailer ate all the tabs, so the formatting of the w

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

2013-10-02 Thread Cong Hou
; { > dst[j] = t; > s *= t; > } > >return s; > } > > where without the fix the loop vectorization is missed. > > David > > On Fri, Sep 27, 2013 at 6:28 PM, Cong Hou wrote: >> The current GCC vectorizer requires the foll

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-02 Thread Cong Hou
On Wed, Oct 2, 2013 at 4:24 AM, Richard Biener wrote: > On Tue, 1 Oct 2013, Cong Hou wrote: > >> When alias exists between data refs in a loop, to vectorize it GCC >> does loop versioning and adds runtime alias checks. Basically for each >> pair of data refs with possibl

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-02 Thread Cong Hou
On Wed, Oct 2, 2013 at 2:18 PM, Xinliang David Li wrote: > On Wed, Oct 2, 2013 at 4:24 AM, Richard Biener wrote: >> On Tue, 1 Oct 2013, Cong Hou wrote: >> >>> When alias exists between data refs in a loop, to vectorize it GCC >>> does loop versioning and adds ru

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-02 Thread Cong Hou
Oct 2, 2013 at 2:18 PM, Xinliang David Li wrote: > On Wed, Oct 2, 2013 at 4:24 AM, Richard Biener wrote: >> On Tue, 1 Oct 2013, Cong Hou wrote: >> >>> When alias exists between data refs in a loop, to vectorize it GCC >>> does loop versioning and adds runtime alias c

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-02 Thread Cong Hou
base[i] = &buffer[i*N]; > > b1 = base[0]; > b2 = base[1]; > ... > for () > { >.. b1[i].. > .. > } After loop unrolling this case becomes the same as the last one. thanks, Cong > > David > > > On Wed, Oct 2, 2013 at 2:34 PM, Cong Hou wrot

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-03 Thread Cong Hou
for merging alias checks? Then we can avoid to modify or create other structures. thanks, Cong On Wed, Oct 2, 2013 at 2:34 PM, Cong Hou wrote: > On Wed, Oct 2, 2013 at 4:24 AM, Richard Biener wrote: >> On Tue, 1 Oct 2013, Cong Hou wrote: >> >>> When alias exists bet

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-03 Thread Cong Hou
On Thu, Oct 3, 2013 at 2:06 PM, Joseph S. Myers wrote: > On Tue, 1 Oct 2013, Cong Hou wrote: > >> +#include >> +#include >> +#include >> + >> #include "config.h" > > Whatever the other issues about including these headers at all, any syste

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-10-03 Thread Cong Hou
anks, Cong On Thu, Oct 3, 2013 at 10:57 AM, Cong Hou wrote: > I noticed that there is a "struct dataref_aux" defined in > tree-vectorizer.h which is specific to the vectorizer pass and is > stored in (void*)aux in "struct data_reference". Can we add one more > field

[PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-03 Thread Cong Hou
During loop versioning in vectorization, the alias check guarantees that any load of a data reference with zero-step is a loop invariant, which can be hoisted outside of the loop. After hoisting the load statement, there may exist more loop invariant statements. This patch tries to find all those s

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

2013-10-03 Thread Cong Hou
Ping... thanks, Cong On Fri, Sep 20, 2013 at 9:49 AM, Cong Hou wrote: > Any comment or more suggestions on this patch? > > > thanks, > Cong > > On Mon, Sep 9, 2013 at 7:28 PM, Cong Hou wrote: >> On Mon, Sep 9, 2013 at 6:26 PM, Xinliang David Li wrote: >>

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

2013-10-07 Thread Cong Hou
ChangeLog (revision 203250) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2013-10-07 Cong Hou + + * convert.c (convert_to_real): Forbid unsafe math function + conversions including sin/cos/log etc. Add precision check + for sqrt. + 2013-10-07 Bill Schmidt * config/rs6000/rs6000.c (altiv

Fwd: [PATCH] Reducing number of alias checks in vectorization.

2013-10-14 Thread Cong Hou
Sorry for forgetting using plain-text mode. Resend it. -- Forwarded message -- From: Cong Hou Date: Mon, Oct 14, 2013 at 3:29 PM Subject: Re: [PATCH] Reducing number of alias checks in vectorization. To: Richard Biener , GCC Patches Cc: Jakub Jelinek I have made a new patch

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-14 Thread Cong Hou
Any comment on this patch? thanks, Cong On Thu, Oct 3, 2013 at 3:59 PM, Cong Hou wrote: > During loop versioning in vectorization, the alias check guarantees > that any load of a data reference with zero-step is a loop invariant, > which can be hoisted outside of the loop. After hoi

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

2013-10-14 Thread Cong Hou
Ping... thanks, Cong On Wed, Oct 2, 2013 at 11:18 AM, Cong Hou wrote: > Ping.. Any comment on this patch? > > > thanks, > Cong > > > On Sat, Sep 28, 2013 at 9:34 AM, Xinliang David Li wrote: >> You can also add a test case of this form: >> >> int f

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

2013-10-15 Thread Cong Hou
I have corrected the ChangeLog format, and committed this patch. Thank you! Cong On Tue, Oct 15, 2013 at 6:38 AM, Richard Biener wrote: > On Sat, Sep 28, 2013 at 3:28 AM, Cong Hou wrote: >> The current GCC vectorizer requires the following pattern as a simple >> reduct

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-15 Thread Cong Hou
Thank you for your reminder, Jeff! I just noticed Richard's comment. I have modified the patch according to that. The new patch is attached. thanks, Cong On Tue, Oct 15, 2013 at 12:33 PM, Jeff Law wrote: > On 10/14/13 17:31, Cong Hou wrote: >> >> Any comment on this patc

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-16 Thread Cong Hou
On Wed, Oct 16, 2013 at 2:02 AM, Richard Biener wrote: > On Tue, 15 Oct 2013, Cong Hou wrote: > >> Thank you for your reminder, Jeff! I just noticed Richard's comment. I >> have modified the patch according to that. >> >> The new patch is attached. > > (po

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-17 Thread Cong Hou
branch and make the code more brief. I have updated the patch and also included the nested loop example into the test case. Thank you! Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a38316..2637309 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-10-15 Cong Hou

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

2013-10-17 Thread Cong Hou
Ping? thanks, Cong On Mon, Oct 7, 2013 at 10:15 AM, Cong Hou wrote: > You are right. I am not an expert on numerical analysis, but I tested > your case and it proves the number 4 conversion is not safe. > > Now we have four conversions which are safe once the precision >

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-21 Thread Cong Hou
Jeff, thank you for installing this patch. Actually I already have the write privileges. I just came back from a trip. Thank you again! thanks, Cong On Fri, Oct 18, 2013 at 10:22 PM, Jeff Law wrote: > On 10/18/13 03:56, Richard Biener wrote: >> >> On Thu, 17 Oct 2013,

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-10-21 Thread Cong Hou
Henderson shend...@gcc.gnu.org Matthew Hiller hil...@redhat.com Manfred Hollstein m...@suse.com +Cong Hou co...@google.com Falk Hueffner f...@debian.o

[PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-22 Thread Cong Hou
and analysis. thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a38316..e0f33ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-10-22 Cong Hou + + PR target/58762 + * convert.c (convert_to_integer): Convert (char) abs ((int) char_val) + into abs (char

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-23 Thread Cong Hou
On Tue, Oct 22, 2013 at 8:11 PM, wrote: > > > Sent from my iPad > >> On Oct 22, 2013, at 7:23 PM, Cong Hou wrote: >> >> This patch aims at PR58762. >> >> Currently GCC could not vectorize abs() operation for integers on x86 >> with only SSE2 supp

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-23 Thread Cong Hou
On Wed, Oct 23, 2013 at 12:20 AM, Uros Bizjak wrote: > Hello! > >> Currently GCC could not vectorize abs() operation for integers on x86 >> with only SSE2 support. For int type, the reason is that the expand on >> abs() is not defined for vector type. This patch defines such an >> expand so that a

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-23 Thread Cong Hou
On Wed, Oct 23, 2013 at 8:52 AM, Joseph S. Myers wrote: > On Tue, 22 Oct 2013, Cong Hou wrote: > >> For abs(char/short), type conversions are needed as the current abs() >> function/operation does not accept argument of char/short type. >> Therefore when we want to get

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-23 Thread Cong Hou
, Cong On Wed, Oct 23, 2013 at 9:40 PM, Cong Hou wrote: > On Wed, Oct 23, 2013 at 8:52 AM, Joseph S. Myers > wrote: >> On Tue, 22 Oct 2013, Cong Hou wrote: >> >>> For abs(char/short), type conversions are needed as the current abs() >>> function/operation do

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

2013-10-24 Thread Cong Hou
, 7 Oct 2013, Cong Hou wrote: > >> + if (type != newtype) >> +break; > > That comparison would wrongly treat as different cases where the types > differ only in one being a typedef, having qualifiers, etc. - or if in > future GCC implemented proposed TS 18661-3, cases w

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-24 Thread Cong Hou
On Wed, Oct 23, 2013 at 11:18 PM, Jakub Jelinek wrote: > On Wed, Oct 23, 2013 at 09:40:21PM -0700, Cong Hou wrote: >> On Wed, Oct 23, 2013 at 8:52 AM, Joseph S. Myers >> wrote: >> > On Tue, 22 Oct 2013, Cong Hou wrote: >> > >> >> For abs(char/short

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-28 Thread Cong Hou
Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a38316..84c7ab5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-10-22 Cong Hou + + PR target/58762 + * config/i386/i386-protos.h (ix86_expand_sse2_abs): New function. + * config/i386/i386.c (ix86_expand_sse2_abs): N

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-29 Thread Cong Hou
attached a text file in which all tabs are there. The updated patch is pasted below (and also in the attached file). Thank you very much for your comment! Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a38316..84c7ab5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-29 Thread Cong Hou
On Tue, Oct 29, 2013 at 10:34 AM, Uros Bizjak wrote: > On Tue, Oct 29, 2013 at 6:18 PM, Cong Hou wrote: > >>>> For the define_expand I added as below, the else body is there to >>>> avoid fall-through transformations to ABS operation in optabs.c. >>>>

[PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-10-29 Thread Cong Hou
g +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2013-10-29 Cong Hou + + * tree-vect-patterns.c (vect_recog_sad_pattern): New function for SAD + pattern recognition. + (type_conversion_p): PROMOTION is true if it's a type promotion + conversion, and false otherwise. Return true if the given expre

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-30 Thread Cong Hou
-22 Cong Hou + + PR target/58762 + * config/i386/i386-protos.h (ix86_expand_sse2_abs): New function. + * config/i386/i386.c (ix86_expand_sse2_abs): New function. + * config/i386/sse.md: Add SSE2 support to abs (8/16/32-bit-int). + 2013-10-14 David Malcolm * dumpfile.h (gcc::dump_manager

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-30 Thread Cong Hou
Forget to attach the patch file. thanks, Cong On Wed, Oct 30, 2013 at 10:01 AM, Cong Hou wrote: > I found my problem: I put DONE outside of if not inside. You are > right. I have updated my patch. > > I appreciate your comment and test on it! > > > thanks, > Cong

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-30 Thread Cong Hou
On Wed, Oct 30, 2013 at 10:22 AM, Uros Bizjak wrote: > On Wed, Oct 30, 2013 at 6:01 PM, Cong Hou wrote: >> I found my problem: I put DONE outside of if not inside. You are >> right. I have updated my patch. > > OK, great that we put things in order ;) > > Does this p

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-30 Thread Cong Hou
Also, as the current expand for abs() on 8/16bit integer is not used at all, should I comment them temporarily now? Later I can uncomment them once I finished the pattern recognizer. thanks, Cong On Wed, Oct 30, 2013 at 10:22 AM, Uros Bizjak wrote: > On Wed, Oct 30, 2013 at 6:01 PM, Cong

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-30 Thread Cong Hou
I have run check_GNU_style.sh on my patch. The patch is submitted. Thank you for your comments and help on this patch! thanks, Cong On Wed, Oct 30, 2013 at 11:13 AM, Uros Bizjak wrote: > On Wed, Oct 30, 2013 at 7:01 PM, Cong Hou wrote: > >>>> I found my problem: I put

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-10-30 Thread Cong Hou
On Wed, Oct 30, 2013 at 4:27 AM, Richard Biener wrote: > On Tue, 29 Oct 2013, Cong Hou wrote: > >> Hi >> >> SAD (Sum of Absolute Differences) is a common and important algorithm >> in image processing and other areas. SSE2 even introduced a new >> instruct

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-10-30 Thread Cong Hou
will add the documentation for the new operation SAD_EXPR. I use sad by just following udot_prod as those two operations are quite similar: OPTAB_D (udot_prod_optab, "udot_prod$I$a") thanks, Cong > > regards > Ramana > > > > > > On Tue, Oct 29, 2013 at 10:23

Re: [PATCH] Vectorizing abs(char/short/int) on x86.

2013-10-31 Thread Cong Hou
This update makes it more safe. You showed me how to write better expand code. Thank you for the improvement! thanks, Cong On Thu, Oct 31, 2013 at 11:43 AM, Uros Bizjak wrote: > On Wed, Oct 30, 2013 at 9:02 PM, Cong Hou wrote: >> I have run check_GNU_style.sh on my patch. >>

[PATCH] Handling == or != comparisons that may affect range test optimization.

2013-10-31 Thread Cong Hou
and make check both get passed. Any comment? thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a38316..9247222 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-10-31 Cong Hou + + PR tree-optimization/58728 + * tree-ssa-reassoc.c (suitable_cond_bb): Consider

[PATCH] Small fix: add { dg-require-effective-target vect_int } to testsuite/gcc.dg/vect/pr58508.c

2013-11-01 Thread Cong Hou
index 9d0f4a5..3d9916d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-10-29 Cong Hou + + * gcc.dg/vect/pr58508.c: Update. + 2013-10-15 Cong Hou * gcc.dg/vect/pr58508.c: New test. diff --git a/gcc/testsuite/gcc.dg/vect/pr58508.c b/gcc

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-04 Thread Cong Hou
On Mon, Nov 4, 2013 at 2:06 AM, James Greenhalgh wrote: > On Fri, Nov 01, 2013 at 04:48:53PM +0000, Cong Hou wrote: >> diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi >> index 2a5a2e1..8f5d39a 100644 >> --- a/gcc/doc/md.texi >> +++ b/gcc/doc/md.texi >> @@ -

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-27 Thread Cong Hou
On Wed, Nov 27, 2013 at 1:53 AM, Richard Biener wrote: > On Fri, 22 Nov 2013, Cong Hou wrote: > >> Hi >> >> Currently in GCC vectorization, some loop invariant may be detected >> after aliasing checks, which can be hoisted outside of the loop. The >>

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-12-02 Thread Cong Hou
Any comment on this patch? thanks, Cong On Fri, Nov 22, 2013 at 11:40 AM, Cong Hou wrote: > On Fri, Nov 22, 2013 at 3:57 AM, Marc Glisse wrote: >> On Thu, 21 Nov 2013, Cong Hou wrote: >> >>> On Thu, Nov 21, 2013 at 4:39 PM, Marc Glisse wrote: >>>> >

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-12-02 Thread Cong Hou
Hi Richard Could you please take a look at this patch and see if it is ready for the trunk? The patch is pasted as a text file here again. Thank you very much! Cong On Mon, Nov 11, 2013 at 11:25 AM, Cong Hou wrote: > Hi James > > Sorry for the late reply. > > > On Fri, N

[PATCH] Enhancing the widen-mult pattern in vectorization.

2013-12-03 Thread Cong Hou
thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f298c0b..44ed204 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2013-12-02 Cong Hou + + * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Enhance + the widen-mult pattern by handling two operands with diffe

Re: [PATCH] Hoist loop invariant statements containing data refs with zero-step during loop-versioning in vectorization.

2013-12-05 Thread Cong Hou
Hi Richard You mentioned that Micha has a patch pending that enables of zero-step stores. What is the status of this patch? I could not find it through searching "Micha". Thank you! Cong On Wed, Oct 16, 2013 at 2:02 AM, Richard Biener wrote: > On Tue, 15 Oct 2013, Cong Hou wrot

Re: [PATCH] Enhancing the widen-mult pattern in vectorization.

2013-12-06 Thread Cong Hou
pe T2. This strategy makes the patch more clean. Bootstrapped and tested on an x86-64 machine. thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f298c0b..12990b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-12-02 Cong Hou + + * tree-vect-patte

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-12-17 Thread Cong Hou
Ping? thanks, Cong On Mon, Dec 2, 2013 at 5:06 PM, Cong Hou wrote: > Hi Richard > > Could you please take a look at this patch and see if it is ready for > the trunk? The patch is pasted as a text file here again. > > Thank you very much! > > > Cong > > &

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-12-17 Thread Cong Hou
Ping? thanks, Cong On Mon, Dec 2, 2013 at 5:02 PM, Cong Hou wrote: > Any comment on this patch? > > > thanks, > Cong > > > On Fri, Nov 22, 2013 at 11:40 AM, Cong Hou wrote: >> On Fri, Nov 22, 2013 at 3:57 AM, Marc Glisse wrote: >>> On Thu, 21 Nov 201

Re: [PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2014-01-13 Thread Cong Hou
I noticed that LIM could not hoist vector invariant, and that is why my first implementation tries to hoist them all. In addition, there are two disadvantages of hoisting invariant load + lim method: First, for some instructions the scalar version is faster than the vector version, and in this ca

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-05 Thread Cong Hou
behavior should not be difficult to explain. If you have more questions or think that the documentation is still improper please let me know. Thank you very much! Cong On Tue, Nov 5, 2013 at 1:53 AM, James Greenhalgh wrote: > On Mon, Nov 04, 2013 at 06:30:55PM +0000, Cong Hou wrote: >> On

Re: [PATCH] Handling == or != comparisons that may affect range test optimization.

2013-11-05 Thread Cong Hou
. thanks, Cong On Tue, Nov 5, 2013 at 12:53 PM, Jakub Jelinek wrote: > On Tue, Nov 05, 2013 at 01:23:00PM -0700, Jeff Law wrote: >> On 10/31/13 18:03, Cong Hou wrote: >> >(This patch is for the bug 58728: >> >http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728) >> >

Re: [PATCH] Handling == or != comparisons that may affect range test optimization.

2013-11-05 Thread Cong Hou
On Tue, Nov 5, 2013 at 12:23 PM, Jeff Law wrote: > On 10/31/13 18:03, Cong Hou wrote: >> >> (This patch is for the bug 58728: >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58728) >> >> As in the bug report, consider the following loop: >> >>

Re: [PATCH] Small fix: add { dg-require-effective-target vect_int } to testsuite/gcc.dg/vect/pr58508.c

2013-11-07 Thread Cong Hou
Ping. OK for the trunk? thanks, Cong On Fri, Nov 1, 2013 at 10:47 AM, Cong Hou wrote: > It seems that on some platforms the loops in > testsuite/gcc.dg/vect/pr58508.c may be unable to be vectorized. This > small patch added { dg-require-effective-target vect_int } to make > su

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-07 Thread Cong Hou
Now is this patch OK for the trunk? Thank you! thanks, Cong On Tue, Nov 5, 2013 at 9:58 AM, Cong Hou wrote: > Thank you for your detailed explanation. > > Once GCC detects a reduction operation, it will automatically > accumulate all elements in the vector after the loop. In

[PATCH] Bug fix for PR59050

2013-11-08 Thread Cong Hou
/ChangeLog @@ -1,3 +1,8 @@ +2013-11-08 Cong Hou + + PR tree-optimization/59050 + * tree-vect-data-refs.c (comp_dr_addr_with_seg_len_pair): Bug fix. + 2013-11-07 Cong Hou * tree-vect-loop-manip.c (vect_create_cond_for_alias_checks): diff --git a/gcc/tree-vect-data-refs.c b/gcc

Re: [PATCH] Reducing number of alias checks in vectorization.

2013-11-08 Thread Cong Hou
Thank you for the report. I have submitted a bug fix patch waiting to be reviewed. thanks, Cong On Fri, Nov 8, 2013 at 5:26 AM, Dominique Dhumieres wrote: > According to http://gcc.gnu.org/ml/gcc-regression/2013-11/msg00197.html > revision 204538 is breaking several tests. On x86_64-apple-dar

Re: [PATCH] Bug fix for PR59050

2013-11-08 Thread Cong Hou
Yes, I think so. The bug is that the arguments of tree_int_cst_compare() may not be constant integers. This patch should take care of it. thanks, Cong On Fri, Nov 8, 2013 at 12:06 PM, H.J. Lu wrote: > On Fri, Nov 8, 2013 at 10:34 AM, Cong Hou wrote: >> http://gcc.gnu.org

Re: [PATCH] Bug fix for PR59050

2013-11-11 Thread Cong Hou
Hi Jeff I have committed the fix. Please update your repo. Thank you! Cong On Mon, Nov 11, 2013 at 10:32 AM, Jeff Law wrote: > On 11/11/13 02:32, Richard Biener wrote: >> >> On Fri, 8 Nov 2013, Cong Hou wrote: >> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?i

Re: [PATCH] Bug fix for PR59050

2013-11-11 Thread Cong Hou
Thank you for your advice! I will follow this instruction in future. thanks, Cong On Mon, Nov 11, 2013 at 1:32 AM, Richard Biener wrote: > On Fri, 8 Nov 2013, Cong Hou wrote: > >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59050 >> >> This is my bad. I forget to c

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-11 Thread Cong Hou
Hi James Sorry for the late reply. On Fri, Nov 8, 2013 at 2:55 AM, James Greenhalgh wrote: >> On Tue, Nov 5, 2013 at 9:58 AM, Cong Hou wrote: >> > Thank you for your detailed explanation. >> > >> > Once GCC detects a reduction operation, it will automaticall

Re: [PATCH] Small fix: add { dg-require-effective-target vect_int } to testsuite/gcc.dg/vect/pr58508.c

2013-11-12 Thread Cong Hou
+1,7 @@ +2013-11-12 Cong Hou + + * gcc.dg/vect/pr58508.c: Remove dg-options as vect_int is indicated. + 2013-10-29 Cong Hou * gcc.dg/vect/pr58508.c: Update. diff --git a/gcc/testsuite/gcc.dg/vect/pr58508.c b/gcc/testsuite/gcc.dg/vect/pr58508.c index fff7a04..c4921bb 100644

Re: [PATCH] Small fix: add { dg-require-effective-target vect_int } to testsuite/gcc.dg/vect/pr58508.c

2013-11-12 Thread Cong Hou
Got it! thanks, Cong On Tue, Nov 12, 2013 at 10:05 AM, Jakub Jelinek wrote: > On Tue, Nov 12, 2013 at 10:04:15AM -0800, Cong Hou wrote: >> Thank you for pointing it out. The updated patch is pasted below. I >> will pay attention to it in the future. > > Ok, thanks. &

[PATCH] [Vectorization] Fixing a bug in alias checks merger.

2013-11-12 Thread Cong Hou
gcc/ChangeLog index 2c0554b..5faa5ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2013-11-12 Cong Hou + + * tree-vectorizer.h (struct dr_with_seg_len): Remove the base + address field as it can be obtained from dr. Rename the struct. + * tree-vect-data-ref

[PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-13 Thread Cong Hou
g_complex_method = 2; } /* Common initialization before calling option handlers. */ Index: gcc/c-family/ChangeLog === --- gcc/c-family/ChangeLog (revision 204712) +++ gcc/c-family/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2013-11-13 Cong

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-13 Thread Cong Hou
Ping? thanks, Cong On Mon, Nov 11, 2013 at 11:25 AM, Cong Hou wrote: > Hi James > > Sorry for the late reply. > > > On Fri, Nov 8, 2013 at 2:55 AM, James Greenhalgh > wrote: >>> On Tue, Nov 5, 2013 at 9:58 AM, Cong Hou wrote: >>> > Thank you for y

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-14 Thread Cong Hou
d will think GCC performs >> poorly. > > > Correctness over speed is better. I am sorry GCC is the only one > which gets it correct here. If people don't like there is a flag to > disable it. > > Thanks, > Andrew Pinski > >> >> thanks, >> >>

[PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-14 Thread Cong Hou
/ChangeLog b/gcc/ChangeLog index 2c0554b..656d5fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,31 @@ +2013-11-14 Cong Hou + + * tree-vect-slp.c (vect_create_new_slp_node): Initialize + SLP_TREE_OP_CODE. + (slp_supported_non_isomorphic_op): New function. Check if the + non-isomorphic

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-15 Thread Cong Hou
Any more comments? thanks, Cong On Wed, Nov 13, 2013 at 6:06 PM, Cong Hou wrote: > Ping? > > > thanks, > Cong > > > On Mon, Nov 11, 2013 at 11:25 AM, Cong Hou wrote: >> Hi James >> >> Sorry for the late reply. >> >> >> On Fri, Nov

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-18 Thread Cong Hou
ss, we could not use this method for float values. What do you think? thanks, Cong On Fri, Nov 15, 2013 at 12:53 AM, Richard Biener wrote: > On Thu, 14 Nov 2013, Cong Hou wrote: > >> Hi >> >> This patch adds the support to two non-isomorphic operations addsub >

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-18 Thread Cong Hou
On Fri, Nov 15, 2013 at 1:20 AM, Uros Bizjak wrote: > Hello! > >> This patch adds the support to two non-isomorphic operations addsub >> and subadd for SLP vectorizer. More non-isomorphic operations can be >> added later, but the limitation is that operations on even/odd >> elements should still b

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-18 Thread Cong Hou
On Fri, Nov 15, 2013 at 10:18 AM, Richard Earnshaw wrote: > On 15/11/13 02:06, Cong Hou wrote: >> Hi >> >> This patch adds the support to two non-isomorphic operations addsub >> and subadd for SLP vectorizer. More non-isomorphic operations can be >> added

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-18 Thread Cong Hou
On Mon, Nov 18, 2013 at 12:27 PM, Uros Bizjak wrote: > On Mon, Nov 18, 2013 at 9:15 PM, Cong Hou wrote: > >>>> This patch adds the support to two non-isomorphic operations addsub >>>> and subadd for SLP vectorizer. More non-isomorphic operations can be >>&

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-19 Thread Cong Hou
On Tue, Nov 19, 2013 at 1:45 AM, Richard Biener wrote: > > On Mon, 18 Nov 2013, Cong Hou wrote: > > > I tried your method and it works well for doubles. But for float, > > there is an issue. For the following gimple code: > > > >c1 = a - b; > >c2 =

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2013-11-20 Thread Cong Hou
Ping... thanks, Cong On Fri, Nov 15, 2013 at 9:52 AM, Cong Hou wrote: > Any more comments? > > > > thanks, > Cong > > > On Wed, Nov 13, 2013 at 6:06 PM, Cong Hou wrote: >> Ping? >> >> >> thanks, >> Cong >> >> >> On

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-21 Thread Cong Hou
On Thu, Nov 21, 2013 at 4:39 PM, Marc Glisse wrote: > On Thu, 21 Nov 2013, Cong Hou wrote: > >> While I added the new define_insn_and_split for vec_merge, a bug is >> exposed: in config/i386/sse.md, [ define_expand "xop_vmfrcz2" ] >> only takes one input, but t

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-22 Thread Cong Hou
On Fri, Nov 22, 2013 at 1:32 AM, Uros Bizjak wrote: > Hello! > >> In consequence, the ix86_expand_multi_arg_builtin() function tries to >> check two args but based on the define_expand of xop_vmfrcz2, >> the content of insn_data[CODE_FOR_xop_vmfrczv4sf2].operand[2] may be >> incorrect (because it

Re: [PATCH] Support addsub/subadd as non-isomorphic operations for SLP vectorizer.

2013-11-22 Thread Cong Hou
On Fri, Nov 22, 2013 at 3:57 AM, Marc Glisse wrote: > On Thu, 21 Nov 2013, Cong Hou wrote: > >> On Thu, Nov 21, 2013 at 4:39 PM, Marc Glisse wrote: >>> >>> On Thu, 21 Nov 2013, Cong Hou wrote: >>> >>>> While I added the new define_insn_and_sp

[PATCH] Fixing PR59006 and PR58921 by delaying loop invariant hoisting in vectorizer.

2013-11-22 Thread Cong Hou
on an x86-64 machine. thanks, Cong diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c0554b..0614bab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2013-11-22 Cong Hou + + PR tree-optimization/58921 + PR tree-optimization/59006 + * tree-vectorizer.h (struct _stmt_vec_info)

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2014-06-23 Thread Cong Hou
the trunk? If it is necessary I can re-post this patch in a new thread. Thank you! Cong On Tue, Dec 17, 2013 at 10:04 AM, Cong Hou wrote: > > Ping? > > > thanks, > Cong > > > On Mon, Dec 2, 2013 at 5:06 PM, Cong Hou wrote: > > Hi Richard > > > > C

Re: [PATCH] Introducing SAD (Sum of Absolute Differences) operation to GCC vectorizer.

2014-06-24 Thread Cong Hou
OK. Thank you very much for your review, Richard! thanks, Cong On Tue, Jun 24, 2014 at 4:19 AM, Richard Biener wrote: > On Tue, Dec 3, 2013 at 2:06 AM, Cong Hou wrote: >> Hi Richard >> >> Could you please take a look at this patch and see if it is ready for >> the

  1   2   >