Re: [PATCH] A jump threading opportunity for condition branch

2019-06-06 Thread Jeff Law
On 5/31/19 9:03 AM, Jeff Law wrote: > On 5/31/19 1:24 AM, Richard Biener wrote: >> On Thu, 30 May 2019, Jeff Law wrote: >> >>> On 5/30/19 12:41 AM, Richard Biener wrote: On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: > On 5/23/19 6:11 AM, Richard Biener wrote: >> On Thu, 23 Ma

Re: [PATCH] A jump threading opportunity for condition branch

2019-06-04 Thread Richard Biener
On Tue, 4 Jun 2019, Jiufu Guo wrote: > Jeff Law writes: > > > On 5/31/19 1:24 AM, Richard Biener wrote: > >> On Thu, 30 May 2019, Jeff Law wrote: > >> > >>> On 5/30/19 12:41 AM, Richard Biener wrote: > On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: > > On 5/23/19 6:11 AM, Rich

Re: [PATCH] A jump threading opportunity for condition branch

2019-06-03 Thread Jiufu Guo
Jeff Law writes: > On 5/31/19 1:24 AM, Richard Biener wrote: >> On Thu, 30 May 2019, Jeff Law wrote: >> >>> On 5/30/19 12:41 AM, Richard Biener wrote: On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: > On 5/23/19 6:11 AM, Richard Biener wrote: >> On Thu, 23 May 2019, Jiufu Gu

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-31 Thread Jeff Law
On 5/31/19 1:24 AM, Richard Biener wrote: > On Thu, 30 May 2019, Jeff Law wrote: > >> On 5/30/19 12:41 AM, Richard Biener wrote: >>> On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: On 5/23/19 6:11 AM, Richard Biener wrote: > On Thu, 23 May 2019, Jiufu Guo wrote: > >> Hi, >

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-31 Thread Richard Biener
On Thu, 30 May 2019, Jeff Law wrote: > On 5/30/19 12:41 AM, Richard Biener wrote: > > On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: > >> On 5/23/19 6:11 AM, Richard Biener wrote: > >>> On Thu, 23 May 2019, Jiufu Guo wrote: > >>> > Hi, > > Richard Biener writes: > > >

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-30 Thread Jeff Law
On 5/30/19 12:41 AM, Richard Biener wrote: > On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: >> On 5/23/19 6:11 AM, Richard Biener wrote: >>> On Thu, 23 May 2019, Jiufu Guo wrote: >>> Hi, Richard Biener writes: > On Tue, 21 May 2019, Jiufu Guo wrote: >> >> +

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-30 Thread Jeff Law
On 5/30/19 12:44 AM, Richard Biener wrote: > On May 29, 2019 10:21:46 PM GMT+02:00, Jeff Law wrote: >> On 5/24/19 6:45 AM, Richard Biener wrote: >> [ Aggressive snipping ] >> >>> As said in my first review I'd just check whether for the >>> edge we want to thread through the definition comes from

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-30 Thread Jeff Law
On 5/30/19 12:57 AM, Jiufu Guo wrote: > Richard Biener writes: > >> On May 29, 2019 10:21:46 PM GMT+02:00, Jeff Law wrote: >>> On 5/24/19 6:45 AM, Richard Biener wrote: >>> [ Aggressive snipping ] >>> As said in my first review I'd just check whether for the edge we want to thread thro

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jiufu Guo
Richard Biener writes: > On May 29, 2019 10:21:46 PM GMT+02:00, Jeff Law wrote: >>On 5/24/19 6:45 AM, Richard Biener wrote: >>[ Aggressive snipping ] >> >>> As said in my first review I'd just check whether for the >>> edge we want to thread through the definition comes from a CMP. >>> Suppose y

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Richard Biener
On May 29, 2019 10:21:46 PM GMT+02:00, Jeff Law wrote: >On 5/24/19 6:45 AM, Richard Biener wrote: >[ Aggressive snipping ] > >> As said in my first review I'd just check whether for the >> edge we want to thread through the definition comes from a CMP. >> Suppose you have >> >> # val_1 = PHI >>

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Richard Biener
On May 29, 2019 10:18:01 PM GMT+02:00, Jeff Law wrote: >On 5/23/19 6:11 AM, Richard Biener wrote: >> On Thu, 23 May 2019, Jiufu Guo wrote: >> >>> Hi, >>> >>> Richard Biener writes: >>> On Tue, 21 May 2019, Jiufu Guo wrote: > > +} > + > + if (TREE_CODE_CLASS (gimple_assign_r

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Richard Biener
On May 29, 2019 10:12:31 PM GMT+02:00, Jeff Law wrote: >On 5/23/19 6:05 AM, Jiufu Guo wrote: >> Hi, >> >> Richard Biener writes: >> >>> On Tue, 21 May 2019, Jiufu Guo wrote: >>> > +/* Return true if PHI's INDEX-th incoming value is a CMP, and the >CMP is + defined in the inco

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jiufu Guo
Jeff Law writes: > On 5/23/19 6:11 AM, Richard Biener wrote: >> On Thu, 23 May 2019, Jiufu Guo wrote: >> >>> Hi, >>> >>> Richard Biener writes: >>> On Tue, 21 May 2019, Jiufu Guo wrote: > > +} > + > + if (TREE_CODE_CLASS (gimple_assign_rhs_code (def)) != tcc_comparison) >>

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jeff Law
On 5/24/19 6:45 AM, Richard Biener wrote: [ Aggressive snipping ] > As said in my first review I'd just check whether for the > edge we want to thread through the definition comes from a CMP. > Suppose you have > > # val_1 = PHI > if (val_1 != 0) > > and only one edge has a b_3 = d_5 != 0 con

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jeff Law
On 5/23/19 6:11 AM, Richard Biener wrote: > On Thu, 23 May 2019, Jiufu Guo wrote: > >> Hi, >> >> Richard Biener writes: >> >>> On Tue, 21 May 2019, Jiufu Guo wrote: +} + + if (TREE_CODE_CLASS (gimple_assign_rhs_code (def)) != tcc_comparison) +return false; + >>>

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jeff Law
On 5/23/19 6:05 AM, Jiufu Guo wrote: > Hi, > > Richard Biener writes: > >> On Tue, 21 May 2019, Jiufu Guo wrote: >> >>> >>> +/* Return true if PHI's INDEX-th incoming value is a CMP, and the CMP is >>> + defined in the incoming basic block. Otherwise return false. */ >>> +static bool >>> +

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-29 Thread Jeff Law
On 5/21/19 7:44 AM, Jiufu Guo wrote: > Hi, > > This patch implements a new opportunity of jump threading for PR77820. > In this optimization, conditional jumps are merged with unconditional jump. > And then moving CMP result to GPR is eliminated. > > It looks like below: > > > p0 = a CMP b

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-24 Thread Jiufu Guo
Richard Biener writes: > On Thu, 23 May 2019, Jiufu Guo wrote: > >> Richard Biener writes: >> >> > On Thu, 23 May 2019, Jiufu Guo wrote: >> > >> >> Hi, >> >> >> >> Richard Biener writes: >> >> >> >> > On Tue, 21 May 2019, Jiufu Guo wrote: >> >> > >> >> >> Hi, >> >> >> >> >> >> This patch im

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-24 Thread Richard Biener
On Thu, 23 May 2019, Jiufu Guo wrote: > Richard Biener writes: > > > On Thu, 23 May 2019, Jiufu Guo wrote: > > > >> Hi, > >> > >> Richard Biener writes: > >> > >> > On Tue, 21 May 2019, Jiufu Guo wrote: > >> > > >> >> Hi, > >> >> > >> >> This patch implements a new opportunity of jump thread

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-23 Thread Jiufu Guo
Richard Biener writes: > On Thu, 23 May 2019, Jiufu Guo wrote: > >> Hi, >> >> Richard Biener writes: >> >> > On Tue, 21 May 2019, Jiufu Guo wrote: >> > >> >> Hi, >> >> >> >> This patch implements a new opportunity of jump threading for PR77820. >> >> In this optimization, conditional jumps ar

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-23 Thread Richard Biener
On Thu, 23 May 2019, Jiufu Guo wrote: > Hi, > > Richard Biener writes: > > > On Tue, 21 May 2019, Jiufu Guo wrote: > > > >> Hi, > >> > >> This patch implements a new opportunity of jump threading for PR77820. > >> In this optimization, conditional jumps are merged with unconditional jump. > >>

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-23 Thread Jiufu Guo
Hi, Richard Biener writes: > On Tue, 21 May 2019, Jiufu Guo wrote: > >> Hi, >> >> This patch implements a new opportunity of jump threading for PR77820. >> In this optimization, conditional jumps are merged with unconditional jump. >> And then moving CMP result to GPR is eliminated. >> >> It l

Re: [PATCH] A jump threading opportunity for condition branch

2019-05-22 Thread Richard Biener
On Tue, 21 May 2019, Jiufu Guo wrote: > Hi, > > This patch implements a new opportunity of jump threading for PR77820. > In this optimization, conditional jumps are merged with unconditional jump. > And then moving CMP result to GPR is eliminated. > > It looks like below: > > > p0 = a CMP

[PATCH] A jump threading opportunity for condition branch

2019-05-21 Thread Jiufu Guo
Hi, This patch implements a new opportunity of jump threading for PR77820. In this optimization, conditional jumps are merged with unconditional jump. And then moving CMP result to GPR is eliminated. It looks like below: p0 = a CMP b goto ; p1 = c CMP d goto ; # phi = PHI