Re: [PATCH GCC][3/4]Generalize dead store elimination (or store motion) across loop iterations in predcom

2017-07-04 Thread Bin.Cheng
On Tue, Jul 4, 2017 at 12:19 PM, Richard Biener wrote: > On Mon, Jul 3, 2017 at 4:17 PM, Bin.Cheng wrote: >> On Mon, Jul 3, 2017 at 10:38 AM, Richard Biener >> wrote: >>> On Tue, Jun 27, 2017 at 12:49 PM, Bin Cheng wrote: >>>> Hi, >>>&

Re: [PATCH GCC][3/4]Generalize dead store elimination (or store motion) across loop iterations in predcom

2017-07-03 Thread Bin.Cheng
On Mon, Jul 3, 2017 at 10:38 AM, Richard Biener wrote: > On Tue, Jun 27, 2017 at 12:49 PM, Bin Cheng wrote: >> Hi, >> For the moment, tree-predcom.c only supports >> invariant/load-loads/store-loads chains. >> This patch generalizes dead store elimination (or store motion) across loop >> iterat

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-30 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 2:09 PM, Bin.Cheng wrote: > On Wed, Jun 28, 2017 at 1:29 PM, Richard Biener > wrote: >> On Wed, Jun 28, 2017 at 1:46 PM, Bin.Cheng wrote: >>> On Wed, Jun 28, 2017 at 11:58 AM, Richard Biener >>> wrote: >>>> On Tue, Jun 27, 2017

Re: [PATCH GCC][01/13]Introduce internal function IFN_LOOP_DIST_ALIAS

2017-06-30 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 8:29 AM, Richard Biener wrote: > On Tue, Jun 27, 2017 at 6:46 PM, Bin.Cheng wrote: >> On Tue, Jun 27, 2017 at 3:59 PM, Richard Biener >> wrote: >>> On June 27, 2017 4:27:17 PM GMT+02:00, "Bin.Cheng" >>> wrote: >>

Re: Tweak BB analysis for dr_analyze_innermost

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 8:06 PM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, Jun 28, 2017 at 5:56 PM, Richard Sandiford >> wrote: >>> "Bin.Cheng" writes: >>>> Question is what would happen if simple_iv succeeds with non-ZERO

Re: Tweak BB analysis for dr_analyze_innermost

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 5:56 PM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, Jun 28, 2017 at 3:04 PM, Richard Sandiford >> wrote: >>> "Bin.Cheng" writes: >>>> On Wed, Jun 28, 2017 at 2:36 PM, Richard

Re: Tweak BB analysis for dr_analyze_innermost

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 3:04 PM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, Jun 28, 2017 at 2:36 PM, Richard Sandiford >> wrote: >>> Index: gcc/tree-data-ref.c >>> === &

Re: Tweak BB analysis for dr_analyze_innermost

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 2:36 PM, Richard Sandiford wrote: > Index: gcc/tree-data-ref.c > === > --- gcc/tree-data-ref.c 2017-06-28 14:33:41.294720044 +0100 > +++ gcc/tree-data-ref.c 2017-06-28 14:35:30.475155670 +0100 > @@ -749,15 +749

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 1:29 PM, Richard Biener wrote: > On Wed, Jun 28, 2017 at 1:46 PM, Bin.Cheng wrote: >> On Wed, Jun 28, 2017 at 11:58 AM, Richard Biener >> wrote: >>> On Tue, Jun 27, 2017 at 4:07 PM, Bin.Cheng wrote: >>>> On Tue, Jun 27, 2017 at

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-28 Thread Bin.Cheng
On Wed, Jun 28, 2017 at 11:58 AM, Richard Biener wrote: > On Tue, Jun 27, 2017 at 4:07 PM, Bin.Cheng wrote: >> On Tue, Jun 27, 2017 at 1:44 PM, Richard Biener >> wrote: >>> On Fri, Jun 23, 2017 at 12:30 PM, Bin.Cheng wrote: >>>> On Tue, Jun 20, 2017 at 10:2

Re: [PATCH GCC][3/6]New file computing regional register pressure on TREE SSA

2017-06-28 Thread Bin.Cheng
On Tue, Jun 27, 2017 at 6:40 PM, Jeff Law wrote: > On 05/12/2017 05:28 AM, Bin Cheng wrote: >> Hi, >> This patch computes register pressure information on TREE SSA by a backward >> live >> range data flow problem. The major motivation is to estimate register >> pressure >> for inner-most loop o

Re: [PATCH GCC][01/13]Introduce internal function IFN_LOOP_DIST_ALIAS

2017-06-27 Thread Bin.Cheng
On Tue, Jun 27, 2017 at 3:59 PM, Richard Biener wrote: > On June 27, 2017 4:27:17 PM GMT+02:00, "Bin.Cheng" > wrote: >>On Tue, Jun 27, 2017 at 1:58 PM, Richard Biener >> wrote: >>> On Fri, Jun 23, 2017 at 12:10 PM, Bin.Cheng >>wrote: >>>&

Re: [PATCH GCC][01/13]Introduce internal function IFN_LOOP_DIST_ALIAS

2017-06-27 Thread Bin.Cheng
On Tue, Jun 27, 2017 at 1:58 PM, Richard Biener wrote: > On Fri, Jun 23, 2017 at 12:10 PM, Bin.Cheng wrote: >> On Mon, Jun 12, 2017 at 6:02 PM, Bin Cheng wrote: >>> Hi, >>> I was asked by upstream to split the loop distribution patch into small >>> ones. &

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-27 Thread Bin.Cheng
On Tue, Jun 27, 2017 at 1:44 PM, Richard Biener wrote: > On Fri, Jun 23, 2017 at 12:30 PM, Bin.Cheng wrote: >> On Tue, Jun 20, 2017 at 10:22 AM, Bin.Cheng wrote: >>> On Mon, Jun 12, 2017 at 6:03 PM, Bin Cheng wrote: >>>> Hi, >> Rebased V3 for changes in pre

Re: [PATCH GCC][5/6]Record initialization statements and only insert it for valid chains

2017-06-26 Thread Bin.Cheng
On Fri, May 12, 2017 at 12:28 PM, Bin Cheng wrote: > Hi, > This patch caches initialization statements and only inserts it for valid > chains. > Looks like current code even inserts such stmts for invalid chains which will > be > deleted as dead code afterwards. > > Bootstrap and test on x86_64

Re: [PATCH GCC][09/13]Simply cost model merges partitions with the same references

2017-06-23 Thread Bin.Cheng
On Fri, Jun 23, 2017 at 11:48 AM, Richard Biener wrote: > On Fri, Jun 23, 2017 at 12:19 PM, Bin.Cheng wrote: >> On Mon, Jun 19, 2017 at 4:20 PM, Richard Biener >> wrote: >>> On Mon, Jun 19, 2017 at 3:40 PM, Bin.Cheng wrote: >>>> On Wed, Jun 14, 2017 at

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-23 Thread Bin.Cheng
On Tue, Jun 20, 2017 at 10:22 AM, Bin.Cheng wrote: > On Mon, Jun 12, 2017 at 6:03 PM, Bin Cheng wrote: >> Hi, >> This is the main patch rewriting loop distribution in order to handle hmmer. >> It improves loop distribution by versioning loop under runtime alias check

Re: [PATCH GCC][08/13]Refactoring structure partition for distribution

2017-06-23 Thread Bin.Cheng
On Mon, Jun 19, 2017 at 4:18 PM, Richard Biener wrote: > On Mon, Jun 19, 2017 at 3:37 PM, Bin.Cheng wrote: >> On Wed, Jun 14, 2017 at 2:47 PM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >>>> Hi, >>>>

Re: [PATCH GCC][12/13]Workaround reduction statements for distribution

2017-06-23 Thread Bin.Cheng
On Tue, Jun 20, 2017 at 12:36 PM, Richard Biener wrote: > On Tue, Jun 20, 2017 at 11:20 AM, Bin.Cheng wrote: >> On Fri, Jun 16, 2017 at 6:15 PM, Bin.Cheng wrote: >>> On Fri, Jun 16, 2017 at 11:21 AM, Richard Biener >>> wrote: >>>> On Mon, Jun 12, 2017

Re: [PATCH GCC][11/13]Annotate partition by its parallelism execution type

2017-06-23 Thread Bin.Cheng
And the patch. On Fri, Jun 23, 2017 at 11:24 AM, Bin.Cheng wrote: > On Tue, Jun 20, 2017 at 12:34 PM, Richard Biener > wrote: >> On Tue, Jun 20, 2017 at 11:18 AM, Bin.Cheng wrote: >>> On Fri, Jun 16, 2017 at 11:10 AM, Richard Biener >>> wrote: >>>>

Re: [PATCH GCC][11/13]Annotate partition by its parallelism execution type

2017-06-23 Thread Bin.Cheng
On Tue, Jun 20, 2017 at 12:34 PM, Richard Biener wrote: > On Tue, Jun 20, 2017 at 11:18 AM, Bin.Cheng wrote: >> On Fri, Jun 16, 2017 at 11:10 AM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >>>> Hi, >>>> T

Re: [PATCH GCC][10/13]Compute and cache data dependence relation

2017-06-23 Thread Bin.Cheng
On Tue, Jun 20, 2017 at 12:32 PM, Richard Biener wrote: > On Tue, Jun 20, 2017 at 11:15 AM, Bin.Cheng wrote: >> On Fri, Jun 16, 2017 at 11:03 AM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >>>> Hi, >>>> This pa

Re: [PATCH GCC][09/13]Simply cost model merges partitions with the same references

2017-06-23 Thread Bin.Cheng
On Mon, Jun 19, 2017 at 4:20 PM, Richard Biener wrote: > On Mon, Jun 19, 2017 at 3:40 PM, Bin.Cheng wrote: >> On Wed, Jun 14, 2017 at 2:54 PM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >>>> Hi, >>>> Current

Re: [PATCH GCC][01/13]Introduce internal function IFN_LOOP_DIST_ALIAS

2017-06-23 Thread Bin.Cheng
On Mon, Jun 12, 2017 at 6:02 PM, Bin Cheng wrote: > Hi, > I was asked by upstream to split the loop distribution patch into small ones. > It is hard because data structure and algorithm are closely coupled together. > Anyway, this is the patch series with smaller patches. Basically I tried to > s

Re: [PATCH GCC][5/5]Enable tree loop distribution at -O3 and above optimization levels.

2017-06-23 Thread Bin.Cheng
On Fri, Jun 23, 2017 at 6:04 AM, Jeff Law wrote: > On 06/07/2017 02:07 AM, Bin.Cheng wrote: >> On Tue, Jun 6, 2017 at 6:47 PM, Jeff Law wrote: >>> On 06/02/2017 05:52 AM, Bin Cheng wrote: >>>> Hi, >>>> This patch enables -ftree-loop-distribution by d

Re: [PATCH GCC][13/13]Distribute loop with loop versioning under runtime alias check

2017-06-20 Thread Bin.Cheng
On Mon, Jun 12, 2017 at 6:03 PM, Bin Cheng wrote: > Hi, > This is the main patch rewriting loop distribution in order to handle hmmer. > It improves loop distribution by versioning loop under runtime alias check > conditions. > As described in comments, the patch basically implements distribution

Re: [PATCH GCC][12/13]Workaround reduction statements for distribution

2017-06-20 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 6:15 PM, Bin.Cheng wrote: > On Fri, Jun 16, 2017 at 11:21 AM, Richard Biener > wrote: >> On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >>> Hi, >>> For now, loop distribution handles variables used outside of loop as >>> reduct

Re: [PATCH GCC][11/13]Annotate partition by its parallelism execution type

2017-06-20 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 11:10 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> This patch checks and records if partition can be executed in parallel by >> looking if there exists data dependence cycles. The information is needed >> for distribution because

Re: [PATCH GCC][10/13]Compute and cache data dependence relation

2017-06-20 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 11:03 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> This patch computes and caches data dependence relation in a hash table >> so that it can be queried multiple times later for partition dependence >> check. >> Bootstrap and test

Re: [PATCH GCC][07/13]Preserve data references for whole distribution life time

2017-06-19 Thread Bin.Cheng
On Mon, Jun 19, 2017 at 4:16 PM, Richard Biener wrote: > On Mon, Jun 19, 2017 at 3:34 PM, Bin.Cheng wrote: >> On Tue, Jun 13, 2017 at 12:14 PM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >>>> Hi, >>>> This pat

Re: [PATCH GCC][09/13]Simply cost model merges partitions with the same references

2017-06-19 Thread Bin.Cheng
On Wed, Jun 14, 2017 at 2:54 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> Current primitive cost model merges partitions with data references sharing >> the same >> base address. I believe it's designed to maximize data reuse in >> distribution, but >

Re: [PATCH GCC][08/13]Refactoring structure partition for distribution

2017-06-19 Thread Bin.Cheng
On Wed, Jun 14, 2017 at 2:47 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> This patch refactors struct partition for later distribution. It records >> bitmap of data references in struct partition rather than vertices' data in >> partition dependence gra

Re: [PATCH GCC][07/13]Preserve data references for whole distribution life time

2017-06-19 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 12:14 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >> Hi, >> This patch collects and preserves all data references in loop for whole >> distribution life time. It will be used afterwards. >> >> Bootstrap and test on x86_64 and AArch64. Is

Re: [PATCH GCC][06/13]Preserve loop nest in whole distribution life time

2017-06-19 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 12:08 PM, Richard Biener wrote: > On Tue, Jun 13, 2017 at 1:06 PM, Richard Biener > wrote: >> On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >>> Hi, >>> This simple patch computes and preserves loop nest vector for whole >>> distribution >>> life time. The loop nest

Re: [PATCH GCC][12/13]Workaround reduction statements for distribution

2017-06-16 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 11:21 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> For now, loop distribution handles variables used outside of loop as >> reduction. >> This is inaccurate because all partitions contain statement defining >> induction >> vars.

Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split

2017-06-16 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 5:48 PM, Marc Glisse wrote: > On Fri, 16 Jun 2017, Bin.Cheng wrote: > >> On Fri, Jun 16, 2017 at 5:16 PM, Richard Biener >> wrote: >>> >>> On June 16, 2017 3:31:32 PM GMT+02:00, "Bin.Cheng" >>> wrote: >>>&g

Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split

2017-06-16 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 5:16 PM, Richard Biener wrote: > On June 16, 2017 3:31:32 PM GMT+02:00, "Bin.Cheng" > wrote: >>On Fri, Jun 16, 2017 at 2:10 PM, Richard Biener >> wrote: >>> On Fri, Jun 16, 2017 at 3:06 PM, Bin.Cheng >>wrote: >>&g

Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split

2017-06-16 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 2:10 PM, Richard Biener wrote: > On Fri, Jun 16, 2017 at 3:06 PM, Bin.Cheng wrote: >> On Fri, Jun 16, 2017 at 11:49 AM, Richard Biener >> wrote: >>> On Wed, Jun 14, 2017 at 3:07 PM, Bin Cheng wrote: >>>> Hi, >>>> Loop

Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split

2017-06-16 Thread Bin.Cheng
On Fri, Jun 16, 2017 at 11:49 AM, Richard Biener wrote: > On Wed, Jun 14, 2017 at 3:07 PM, Bin Cheng wrote: >> Hi, >> Loop split forces intermediate computation to gimple operands all the time >> when >> computing bound information. This is not good since folding opportunities >> are >> missed

Re: [PATCH GCC][09/13]Simply cost model merges partitions with the same references

2017-06-14 Thread Bin.Cheng
On Wed, Jun 14, 2017 at 2:54 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:03 PM, Bin Cheng wrote: >> Hi, >> Current primitive cost model merges partitions with data references sharing >> the same >> base address. I believe it's designed to maximize data reuse in >> distribution, but >

Re: [PATCH GCC][04/13]Sort statements in topological order for loop distribution

2017-06-14 Thread Bin.Cheng
On Wed, Jun 14, 2017 at 10:15 AM, Richard Biener wrote: > On Wed, Jun 14, 2017 at 9:53 AM, Bin.Cheng wrote: >> On Tue, Jun 13, 2017 at 11:59 AM, Richard Biener >> wrote: >>> On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >>>> Hi, >>>> During t

Re: [PATCH GCC][04/13]Sort statements in topological order for loop distribution

2017-06-14 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 11:59 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >> Hi, >> During the work I ran into a latent bug for distributing. For the moment we >> sort statements >> in dominance order, but that's not enough because basic blocks may be sorted >

Re: [PATCH] Fix PR66313

2017-06-13 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 12:48 PM, Richard Biener wrote: > On Tue, 13 Jun 2017, Richard Sandiford wrote: > >> Richard Biener writes: >> > On Tue, 13 Jun 2017, Richard Sandiford wrote: >> >> Richard Biener writes: >> >> > So I've come back to PR66313 and found a solution to the tailrecursion >> >>

Re: [PATCH] Fix PR66313

2017-06-13 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 12:23 PM, Richard Sandiford wrote: > Richard Biener writes: >> On Tue, 13 Jun 2017, Richard Sandiford wrote: >>> Richard Biener writes: >>> > So I've come back to PR66313 and found a solution to the tailrecursion >>> > missed optimization when fixing the factoring folding

Re: [PATCH GCC][06/13]Preserve loop nest in whole distribution life time

2017-06-13 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 12:06 PM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >> Hi, >> This simple patch computes and preserves loop nest vector for whole >> distribution >> life time. The loop nest will be used multiple times in on-demand data >> dependence >> c

Re: [PATCH GCC][03/13]Mark and skip distributed loops

2017-06-13 Thread Bin.Cheng
On Tue, Jun 13, 2017 at 11:47 AM, Richard Biener wrote: > On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng wrote: >> Hi, >> This simple patch marks distributed loops and skips it in following >> distribution. >> >> Bootstrap and test on x86_64 and AArch64. Is it OK? > > This is not necessary, FOR_EAC

Re: [PATCH PR78005]Fix miscompare issue by computing correct guard condition for vectorized loop

2017-06-12 Thread Bin.Cheng
On Mon, Jun 12, 2017 at 9:19 AM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Sat, Jun 10, 2017 at 10:40 AM, Richard Sandiford >> wrote: >>> Sorry to return this old patch, but: >>> >>> Bin Cheng writes: >>>> -/* Ca

Re: [PATCH GCC8][32/33]Save niter check for vect peeling if loop versioning is required

2017-06-12 Thread Bin.Cheng
On Sat, Jun 10, 2017 at 11:06 AM, Richard Sandiford wrote: > Another one sorry, but: > > Bin Cheng writes: >> diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c >> index af874e7..98caa5e 100644 >> --- a/gcc/tree-vect-loop.c >> +++ b/gcc/tree-vect-loop.c >> @@ -2214,6 +2214,36 @@ start_over:

Re: [PATCH PR78005]Fix miscompare issue by computing correct guard condition for vectorized loop

2017-06-11 Thread Bin.Cheng
On Sat, Jun 10, 2017 at 10:40 AM, Richard Sandiford wrote: > Sorry to return this old patch, but: > > Bin Cheng writes: >> -/* Calculate the number of iterations under which scalar loop will be >> - preferred than vectorized loop. NITERS_PROLOG is the number of >> - iterations of prolog loop

Re: [PATCH GCC][4/5]Improve loop distribution to handle hmmer

2017-06-08 Thread Bin.Cheng
On Thu, Jun 8, 2017 at 3:48 AM, kugan wrote: > Hi Bin, > >> + >> +/* In reduced dependence graph RDG for loop distribution, return true if >> + dependence between references DR1 and DR2 may create dependence cycle >> + and such dependence cycle can't be resolved by runtime alias check. >> */ >

Re: [PATCH GCC8][31/33]Set range information for niter bound of vectorized loop

2017-06-07 Thread Bin.Cheng
On Wed, May 24, 2017 at 2:48 PM, Richard Biener wrote: > On Mon, May 22, 2017 at 7:13 PM, Bin.Cheng wrote: >> On Fri, May 19, 2017 at 1:51 PM, Richard Biener >> wrote: >>> On Mon, May 15, 2017 at 5:58 PM, Bin.Cheng wrote: >>>> On Thu, May 11, 2017 at

Re: [PATCH GCC8][32/33]Save niter check for vect peeling if loop versioning is required

2017-06-07 Thread Bin.Cheng
On Thu, May 11, 2017 at 12:06 PM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:54 PM, Bin Cheng wrote: >> Hi, >> When loop versioning is required in vectorization, we can merge niter check >> for vect >> peeling with the check for loop versioning, thus save one check/branch for >> vectori

Re: [PATCH GCC8][30/33]Fold more type conversion into binary arithmetic operations

2017-06-07 Thread Bin.Cheng
On Wed, May 17, 2017 at 1:27 PM, Richard Biener wrote: > On Mon, May 15, 2017 at 5:56 PM, Bin.Cheng wrote: >> On Thu, May 11, 2017 at 11:54 AM, Richard Biener >> wrote: >>> On Tue, Apr 18, 2017 at 12:53 PM, Bin Cheng wrote: >>>> Hi, >>>> Simplifi

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-06-07 Thread Bin.Cheng
On Wed, May 17, 2017 at 1:24 PM, Richard Biener wrote: > On Mon, May 15, 2017 at 5:50 PM, Bin.Cheng wrote: >> On Thu, May 11, 2017 at 11:39 AM, Richard Biener >> wrote: >>> On Tue, Apr 18, 2017 at 12:53 PM, Bin Cheng wrote: >>>> Hi, >>>> Cu

Re: [PATCH GCC][4/5]Improve loop distribution to handle hmmer

2017-06-07 Thread Bin.Cheng
On Wed, Jun 7, 2017 at 11:03 AM, Richard Biener wrote: > On Fri, Jun 2, 2017 at 1:51 PM, Bin Cheng wrote: >> Hi, >> This is the main patch of the change. It improves loop distribution by >> versioning loop under >> runtime alias check conditions, as well as better partition fusion. As >> desc

Re: [PATCH GCC][5/5]Enable tree loop distribution at -O3 and above optimization levels.

2017-06-07 Thread Bin.Cheng
On Wed, Jun 7, 2017 at 9:33 AM, Richard Biener wrote: > On Wed, Jun 7, 2017 at 10:07 AM, Bin.Cheng wrote: >> On Tue, Jun 6, 2017 at 6:47 PM, Jeff Law wrote: >>> On 06/02/2017 05:52 AM, Bin Cheng wrote: >>>> Hi, >>>> This patch enables -ftree-loo

Re: [PATCH GCC][5/5]Enable tree loop distribution at -O3 and above optimization levels.

2017-06-07 Thread Bin.Cheng
On Tue, Jun 6, 2017 at 6:47 PM, Jeff Law wrote: > On 06/02/2017 05:52 AM, Bin Cheng wrote: >> Hi, >> This patch enables -ftree-loop-distribution by default at -O3 and above >> optimization levels. >> Bootstrap and test at O2/O3 on x86_64 and AArch64. is it OK? >> >> Note I don't have strong opin

Re: [PATCH GCC][4/5]Improve loop distribution to handle hmmer

2017-06-05 Thread Bin.Cheng
On Mon, Jun 5, 2017 at 5:21 AM, Kugan Vivekanandarajah wrote: > Hi Bin, > > Thanks for posting the patch. I haven't looked in detail yet but have > couple of quick questions. > > 1. Shouldn’t the run time alias check for versioning happen only when > vectorisation is enabled? You seems to be using

Re: [PATCH TEST]Rectify test case gcc.dg/tree-ssa/ivopt_mult_4.c

2017-05-31 Thread Bin.Cheng
On Fri, May 26, 2017 at 12:49 PM, Richard Biener wrote: > On Thu, May 25, 2017 at 8:00 PM, Bin Cheng wrote: >> Hi, >> I believe this tests has been wrongly modified previously. It is to test >> that the exit check on >> pointer shouldn't be replaced by integer IV. Somehow GCC starts replacing

Re: [PATCH GCC][4/6]Relax minimal segment length of DR_B for merging alias check

2017-05-30 Thread Bin.Cheng
On Tue, May 30, 2017 at 12:27 PM, Richard Biener wrote: > On Thu, May 25, 2017 at 5:16 PM, Bin.Cheng wrote: >> On Tue, May 23, 2017 at 5:23 PM, Bin Cheng wrote: >>> Hi, >>> As commented in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80815#c1, >>> We can rela

Re: [PATCH GCC][2/6]Factor out code pruning runtime alias checks

2017-05-26 Thread Bin.Cheng
On Fri, May 26, 2017 at 12:15 PM, Richard Biener wrote: > On Tue, May 23, 2017 at 6:22 PM, Bin Cheng wrote: >> Hi, >> This is the second patch in the set, it factors out code pruning runtime >> alias >> checks from file tree-vect-data-refs.c to tree-data-ref.c. It also >> introduces >> new int

Re: [PATCH GCC][1/6]Move compare_tree to tree.c and expose the interface.

2017-05-26 Thread Bin.Cheng
On Fri, May 26, 2017 at 12:50 PM, Richard Biener wrote: > On Fri, May 26, 2017 at 1:30 PM, Bin.Cheng wrote: >> On Fri, May 26, 2017 at 12:14 PM, Richard Biener >> wrote: >>> On Tue, May 23, 2017 at 6:22 PM, Bin Cheng wrote: >>>> Hi, >>>> This pat

Re: [PATCH GCC][3/6]Fix PR80815 by handling negative DR_STEPs in runtime alias check

2017-05-26 Thread Bin.Cheng
On Fri, May 26, 2017 at 12:39 PM, Richard Biener wrote: > On Thu, May 25, 2017 at 5:15 PM, Bin.Cheng wrote: >> On Wed, May 24, 2017 at 11:54 AM, Richard Sandiford >> wrote: >>> "Bin.Cheng" writes: >>>> On Tue, May 23, 2017 at 6:53 PM, Richard San

Re: [PATCH GCC][1/6]Move compare_tree to tree.c and expose the interface.

2017-05-26 Thread Bin.Cheng
On Fri, May 26, 2017 at 12:14 PM, Richard Biener wrote: > On Tue, May 23, 2017 at 6:22 PM, Bin Cheng wrote: >> Hi, >> This patch set factors out runtime alias check code from >> tree-vect-data-refs.c >> and tree-vect-loop-manip.c as general interfaces in tree-data-ref.c. With >> this >> change

Re: [PATCH GCC][4/6]Relax minimal segment length of DR_B for merging alias check

2017-05-25 Thread Bin.Cheng
On Tue, May 23, 2017 at 5:23 PM, Bin Cheng wrote: > Hi, > As commented in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80815#c1, > We can relax minimal segment length of DR_B for merging. With this change, > the new test can be improved to only one alias check. Note the > condition is still accu

Re: [PATCH GCC][3/6]Fix PR80815 by handling negative DR_STEPs in runtime alias check

2017-05-25 Thread Bin.Cheng
On Wed, May 24, 2017 at 11:54 AM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Tue, May 23, 2017 at 6:53 PM, Richard Sandiford >> wrote: >>> AIUI, the reason the old code mishandled negative steps was that the >>> associated segment lengths

Re: [PATCH GCC][3/6]Fix PR80815 by handling negative DR_STEPs in runtime alias check

2017-05-24 Thread Bin.Cheng
On Tue, May 23, 2017 at 6:53 PM, Richard Sandiford wrote: > AIUI, the reason the old code mishandled negative steps was that the > associated segment lengths were stored as sizetype and so looked like > big unsigned values. Those values therefore satisfied tree_fits_uhwi_p > even though they were

Re: [PATCH GCC8][31/33]Set range information for niter bound of vectorized loop

2017-05-22 Thread Bin.Cheng
On Fri, May 19, 2017 at 1:51 PM, Richard Biener wrote: > On Mon, May 15, 2017 at 5:58 PM, Bin.Cheng wrote: >> On Thu, May 11, 2017 at 12:02 PM, Richard Biener >> wrote: >>> On Tue, Apr 18, 2017 at 12:54 PM, Bin Cheng wrote >>>> Hi, >>>> Based

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-19 Thread Bin.Cheng
On Fri, May 19, 2017 at 11:09 AM, Robin Dapp wrote: >> I can guess what is happening here. It's a 40 bits unsigned long long >> field, (s.b-8) will be like: >> _1 = s.b >> _2 = _1 + 0xf8 >> Also get_range_info returns value range [0, 0xFF] for _1. >> You'd need to check if _1(with

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 5:08 PM, Robin Dapp wrote: >> Any reason to expose tree-vrp.c internal interface here? The function >> looks quite expensive. Overflow check can be done by get_range_info >> and simple wi::cmp calls. Existing code like in >> tree-ssa-loop-niters.c already does that. Als

Re: [PATCH 2/3] Simplify wrapped binops

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 3:47 PM, Robin Dapp wrote: > match.pd part of the patch. > > gcc/ChangeLog: > > 2017-05-18 Robin Dapp > > * match.pd: Simplify wrapped binary operations. > * tree-vrp.c (extract_range_from_binary_expr_1): Add overflow > parameter. > (extra

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-18 Thread Bin.Cheng
On Thu, May 18, 2017 at 11:41 AM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, May 17, 2017 at 1:37 PM, Richard Sandiford >> wrote: >>> "Bin.Cheng" writes: >>>> -/* Calculates cost for having N_REGS registers. This number in

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-18 Thread Bin.Cheng
On Wed, May 17, 2017 at 1:37 PM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> -/* Calculates cost for having N_REGS registers. This number includes >> - induction variables, invariant variables and invariant expressions. */ >> +/* Estimate register

Re: [PATCH GCC8][31/33]Set range information for niter bound of vectorized loop

2017-05-15 Thread Bin.Cheng
On Thu, May 11, 2017 at 12:02 PM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:54 PM, Bin Cheng wrote >> Hi, >> Based on vect_peeling algorithm, we know for sure that vectorized loop must >> iterates at least once. >> This patch sets range information for niter bounds of vectorized loop.

Re: [PATCH GCC8][30/33]Fold more type conversion into binary arithmetic operations

2017-05-15 Thread Bin.Cheng
On Thu, May 11, 2017 at 11:54 AM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:53 PM, Bin Cheng wrote: >> Hi, >> Simplification of (T1)(X *+- CST) is already implemented in >> aff_combination_expand, >> this patch moves it to tree_to_aff_combination. It also supports unsigned >> types >>

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-15 Thread Bin.Cheng
On Thu, May 11, 2017 at 11:39 AM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:53 PM, Bin Cheng wrote: >> Hi, >> Currently IVOPTs shares the same register pressure computation with RTL loop >> invariant pass, >> which doesn't work very well. This patch introduces specific interface for >

Re: PR78972, 80283: Extend TER with scheduling

2017-05-15 Thread Bin.Cheng
On Mon, May 15, 2017 at 9:27 AM, Richard Biener wrote: > On Fri, May 12, 2017 at 7:51 PM, Bernd Schmidt wrote: >> If you look at certain testcases like the one for PR78972, you'll find that >> the code generated by TER is maximally pessimal in terms of register >> pressure: we can generate a larg

Re: [PATCH GCC8][13/33]Rewrite cost computation of ivopts

2017-05-12 Thread Bin.Cheng
On Fri, May 12, 2017 at 10:50 AM, Bin.Cheng wrote: > On Fri, May 12, 2017 at 8:39 AM, Christophe Lyon > wrote: >> Hi Bin, >> >> >> On 4 May 2017 at 17:25, Bin.Cheng wrote: >>> On Wed, Apr 26, 2017 at 11:18 AM, Richard Biener >>> wrote: >>

Re: [PATCH GCC8][13/33]Rewrite cost computation of ivopts

2017-05-12 Thread Bin.Cheng
On Fri, May 12, 2017 at 8:39 AM, Christophe Lyon wrote: > Hi Bin, > > > On 4 May 2017 at 17:25, Bin.Cheng wrote: >> On Wed, Apr 26, 2017 at 11:18 AM, Richard Biener >> wrote: >>> On Wed, Apr 26, 2017 at 12:12 PM, Bin.Cheng wrote: >>>> On

Re: [PATCH] Tree-level fix for PR 69526

2017-05-11 Thread Bin.Cheng
On Tue, Jan 17, 2017 at 9:48 AM, Richard Biener wrote: > On Tue, Jan 10, 2017 at 2:32 PM, Robin Dapp wrote: >> Perhaps I'm still missing how some cases are handled or not handled, >> sorry for the noise. >> >>> I'm not sure there is anything to "interpret" -- the operation is unsigned >>> and ove

Re: [PATCH GCC8][29/33]New register pressure estimation

2017-05-11 Thread Bin.Cheng
On Thu, May 11, 2017 at 11:39 AM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:53 PM, Bin Cheng wrote: >> Hi, >> Currently IVOPTs shares the same register pressure computation with RTL loop >> invariant pass, >> which doesn't work very well. This patch introduces specific interface for >

Re: [PATCH GCC8][01/33]Handle TRUNCATE between tieable modes in rtx_cost

2017-05-10 Thread Bin.Cheng
On Wed, May 3, 2017 at 11:09 AM, Kyrill Tkachov wrote: > Hi Bin, > > > On 03/05/17 11:02, Bin.Cheng wrote: >> >> On Wed, May 3, 2017 at 9:38 AM, Bin.Cheng wrote: >>> >>> On Wed, May 3, 2017 at 7:17 AM, Eric Botcazou >>> wrote: >>>>

Re: [PATCH GCC8][17/33]Treat complex cand step as invriant expression

2017-05-04 Thread Bin.Cheng
On Wed, May 3, 2017 at 2:43 PM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:46 PM, Bin Cheng wrote: >> Hi, >> We generally need to compute cand step in loop preheader and use it in loop >> body. >> Unless it's an SSA_NAME of constant integer, an invariant expression is >> needed. > > I'm

Re: [PATCH GCC8][25/33]New loop constraint flags

2017-05-04 Thread Bin.Cheng
On Wed, Apr 26, 2017 at 3:01 PM, Bin.Cheng wrote: > On Wed, Apr 26, 2017 at 2:27 PM, Richard Biener > wrote: >> On Tue, Apr 18, 2017 at 12:51 PM, Bin Cheng wrote: >>> Hi, >>> This patch adds new loop constraint flags marking prologue, epilogue and >&g

Re: [PATCH GCC8][28/33]Don't count non-interger PHIs for register pressure

2017-05-04 Thread Bin.Cheng
On Wed, Apr 26, 2017 at 3:32 PM, Bin.Cheng wrote: > On Wed, Apr 26, 2017 at 3:23 PM, Richard Biener > wrote: >> On Wed, Apr 26, 2017 at 3:37 PM, Bin.Cheng wrote: >>> On Wed, Apr 26, 2017 at 2:32 PM, Richard Biener >>> wrote: >>>> On Tue, Apr 18, 20

Re: [PATCH GCC8][13/33]Rewrite cost computation of ivopts

2017-05-04 Thread Bin.Cheng
On Wed, Apr 26, 2017 at 11:18 AM, Richard Biener wrote: > On Wed, Apr 26, 2017 at 12:12 PM, Bin.Cheng wrote: >> On Wed, Apr 26, 2017 at 10:50 AM, Richard Biener >> wrote: >>> On Tue, Apr 18, 2017 at 12:43 PM, Bin Cheng wrote: >>>> Hi, >>>>

Re: [PATCH GCC8][11/33]New interfaces for tree affine

2017-05-04 Thread Bin.Cheng
On Mon, Apr 24, 2017 at 11:43 AM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:43 PM, Bin Cheng wrote: >> Hi, >> This patch adds three simple interfaces for tree affine which will be used in >> cost computation later. >> >> Is it OK? > > > +static inline tree > +aff_combination_type (aff_tr

Re: [PATCH GCC8][07/33]Offset validity check in address expression

2017-05-04 Thread Bin.Cheng
On Wed, May 3, 2017 at 10:49 AM, Richard Biener wrote: > On Tue, May 2, 2017 at 7:06 PM, Bin.Cheng wrote: >> On Mon, Apr 24, 2017 at 11:34 AM, Richard Biener >> wrote: >>> On Tue, Apr 18, 2017 at 12:41 PM, Bin Cheng wrote: >>>> Hi, >>>> For n

Re: Handle data dependence relations with different bases

2017-05-04 Thread Bin.Cheng
On Thu, May 4, 2017 at 11:06 AM, Richard Sandiford wrote: > "Bin.Cheng" writes: >> On Wed, May 3, 2017 at 9:00 AM, Richard Sandiford >> wrote: >>> Index: gcc/tree-data-ref.h >>> === &

Re: Handle data dependence relations with different bases

2017-05-04 Thread Bin.Cheng
On Wed, May 3, 2017 at 9:00 AM, Richard Sandiford wrote: > This patch tries to calculate conservatively-correct distance > vectors for two references whose base addresses are not the same. > It sets a new flag DDR_COULD_BE_INDEPENDENT_P if the dependence > isn't guaranteed to occur. > > The motiva

Re: [PATCH 1/4][PR tree-optimization/78496] Don't simplify conditionals too early in VRP

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 5:32 PM, Jeff Law wrote: > [ With the patch attached... ] > > > On 05/03/2017 10:31 AM, Jeff Law wrote: >> >> This is the first of 3-5 patches to address pr78496. >> >> The goal of these patches is to catch jump threads earlier in the pipeline >> to avoid undesirable behavio

Re: [PATCH GCC8][03/33]Refactor invariant variable/expression handling

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 3:41 PM, Bin.Cheng wrote: > On Wed, May 3, 2017 at 3:38 PM, Christophe Lyon > wrote: >> Hi Bin, >> >> >> On 24 April 2017 at 12:26, Richard Biener wrote: >>> On Tue, Apr 18, 2017 at 12:38 PM, Bin Cheng wrote: >>>> H

Re: [PATCH GCC8][03/33]Refactor invariant variable/expression handling

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 3:38 PM, Christophe Lyon wrote: > Hi Bin, > > > On 24 April 2017 at 12:26, Richard Biener wrote: >> On Tue, Apr 18, 2017 at 12:38 PM, Bin Cheng wrote: >>> Hi, >>> This patch refactors how invariant variable/expressions are handled. Now >>> they are >>> recorded in the sa

Re: Alternative check for vector refs with same alignment

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 11:07 AM, Richard Biener wrote: > On Wed, May 3, 2017 at 9:54 AM, Richard Sandiford > wrote: >> vect_find_same_alignment_drs uses the ddr dependence distance >> to tell whether two references have the same alignment. Although >> that's safe with the current code, there's n

Re: [PATCH GCC8][01/33]Handle TRUNCATE between tieable modes in rtx_cost

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 11:09 AM, Kyrill Tkachov wrote: > Hi Bin, > > > On 03/05/17 11:02, Bin.Cheng wrote: >> >> On Wed, May 3, 2017 at 9:38 AM, Bin.Cheng wrote: >>> >>> On Wed, May 3, 2017 at 7:17 AM, Eric Botcazou >>> wrote: >>>>

Re: [PATCH GCC8][01/33]Handle TRUNCATE between tieable modes in rtx_cost

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 9:38 AM, Bin.Cheng wrote: > On Wed, May 3, 2017 at 7:17 AM, Eric Botcazou wrote: >>> 2017-04-11 Bin Cheng >>> >>> * rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes. >> >> This breaks bootstrap with RTL checkin

Re: [PATCH GCC8][01/33]Handle TRUNCATE between tieable modes in rtx_cost

2017-05-03 Thread Bin.Cheng
On Wed, May 3, 2017 at 7:17 AM, Eric Botcazou wrote: >> 2017-04-11 Bin Cheng >> >> * rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes. > > This breaks bootstrap with RTL checking: > > /home/eric/build/gcc/native/./gcc/xgcc -B/home/eric/build/gcc/native/./gcc/ - > nostdinc -x c

Re: [PATCH GCC8][07/33]Offset validity check in address expression

2017-05-02 Thread Bin.Cheng
On Mon, Apr 24, 2017 at 11:34 AM, Richard Biener wrote: > On Tue, Apr 18, 2017 at 12:41 PM, Bin Cheng wrote: >> Hi, >> For now, we check validity of offset by computing the maximum offset then >> checking if >> offset is smaller than the max offset. This is inaccurate, for example, >> some tar

Re: [PATCH GCC8][22/33]Generate TMR in new reassociation order

2017-05-02 Thread Bin.Cheng
On Tue, May 2, 2017 at 3:09 PM, Richard Biener wrote: > On Wed, Apr 26, 2017 at 12:20 PM, Bin.Cheng wrote: >> This is another one where context diff might help. No code change >> from previous version. > > This isn't a context diff. Thanks for reviewing. I used git d

Re: [PATCH GCC8][14/33]Handle more cheap operations in force_expr_to_var_cost

2017-04-27 Thread Bin.Cheng
On Thu, Apr 27, 2017 at 4:30 PM, Jeff Law wrote: > On 04/26/2017 06:58 AM, Richard Biener wrote: >> >> On Tue, Apr 18, 2017 at 12:44 PM, Bin Cheng >> wrote: >>> >>> Hi, This patch handles more cheap cases in function >>> force_expr_to_var_cost, specifically, TRUNC_DIV_EXPR, BIT_AND_EXPR, >>> BIT_

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