Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-24 Thread Segher Boessenkool
On Fri, Apr 24, 2020 at 08:15:36AM +0200, Richard Biener wrote: > On Thu, Apr 23, 2020 at 4:54 PM Eric Botcazou wrote: > > > > > What is wrong with DF? > > > > > > > > It's slow and memory hungry? > > > > > > Very true, of course. But can this be significantly better? > > > > That's a good questi

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Biener via Gcc-patches
On Thu, Apr 23, 2020 at 4:54 PM Eric Botcazou wrote: > > > > > What is wrong with DF? > > > > > > It's slow and memory hungry? > > > > Very true, of course. But can this be significantly better? > > That's a good question worth investigating in my opinion, because DF didn't > quite achieve its in

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Jeff Law via Gcc-patches
On Thu, 2020-04-23 at 15:16 -0500, Segher Boessenkool wrote: > On Thu, Apr 23, 2020 at 08:40:50AM -0600, Jeff Law wrote: > > On Thu, 2020-04-23 at 15:07 +0200, Richard Biener wrote: > > > On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool > > > wrote: > > > > On Thu, Apr 23, 2020 at 02:25:40PM +02

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Joseph Myers
On Thu, 23 Apr 2020, Richard Biener via Gcc-patches wrote: > I think at least one step would be uncontroversical(?), namely moving > the RTL expansion "magic" > up to a GIMPLE pass. Where the "magic" would be to turn > GIMPLE stmts not directly expandable via an existing optab into > GIMPLE that

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 04:32:51PM +0100, Richard Sandiford wrote: > I also wonder how difficult it would be to get recog to recognise > gimple :-) Since recog recognises single (rtl) insns: hard to impossible? Segher

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 08:40:50AM -0600, Jeff Law wrote: > On Thu, 2020-04-23 at 15:07 +0200, Richard Biener wrote: > > On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool > > wrote: > > > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: > > > > > > But being stuck with something me

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
Hi! On Thu, Apr 23, 2020 at 08:29:34AM -0600, Jeff Law wrote: > On Thu, 2020-04-23 at 07:07 -0500, Segher Boessenkool wrote: > > Most of expand is *other stuff*. Expand does a *lot* of things that are > > actually changing the code. And much of that is not done anywhere else > > either yet, so t

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Jeff Law via Gcc-patches
On Thu, 2020-04-23 at 16:32 +0100, Richard Sandiford wrote: > Jeff Law via Gcc-patches writes: > > On Thu, 2020-04-23 at 15:07 +0200, Richard Biener wrote: > > > On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool > > > wrote: > > > > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote:

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Sandiford
Jeff Law via Gcc-patches writes: > On Thu, 2020-04-23 at 15:07 +0200, Richard Biener wrote: >> On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool >> wrote: >> > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: >> > > > > But being stuck with something means no progress... I know >

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Eric Botcazou
> > > What is wrong with DF? > > > > It's slow and memory hungry? > > Very true, of course. But can this be significantly better? That's a good question worth investigating in my opinion, because DF didn't quite achieve its initial goal of replacing all the custom liveness analysis passes onl

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Jeff Law via Gcc-patches
On Thu, 2020-04-23 at 15:07 +0200, Richard Biener wrote: > On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool > wrote: > > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: > > > > > But being stuck with something means no progress... I know > > > > > very well it's 100 times harder

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Jeff Law via Gcc-patches
On Thu, 2020-04-23 at 07:07 -0500, Segher Boessenkool wrote: > > > I think at least one step would be uncontroversical(?), namely moving > > the RTL expansion "magic" > > up to a GIMPLE pass. Where the "magic" would be to turn > > GIMPLE stmts not directly expandable via an existing optab into >

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 03:07:23PM +0200, Richard Biener wrote: > On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool > wrote: > > > > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: > > > > > But being stuck with something means no progress... I know > > > > > very well it's 100 t

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Biener via Gcc-patches
On Thu, Apr 23, 2020 at 2:52 PM Segher Boessenkool wrote: > > On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: > > > > But being stuck with something means no progress... I know > > > > very well it's 100 times harder to get rid of something than to > > > > add something new ontop.

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 02:25:40PM +0200, Richard Biener wrote: > > > But being stuck with something means no progress... I know > > > very well it's 100 times harder to get rid of something than to > > > add something new ontop. > > > > Well, what progress do you expect to make? After expand tha

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Biener via Gcc-patches
On Thu, Apr 23, 2020 at 2:07 PM Segher Boessenkool wrote: > > On Thu, Apr 23, 2020 at 12:52:30PM +0200, Richard Biener wrote: > > On Thu, Apr 23, 2020 at 12:17 PM Segher Boessenkool > > wrote: > > > > > > On Thu, Apr 23, 2020 at 09:32:37AM +0200, Richard Biener wrote: > > > > On Thu, Apr 23, 2020

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 12:52:30PM +0200, Richard Biener wrote: > On Thu, Apr 23, 2020 at 12:17 PM Segher Boessenkool > wrote: > > > > On Thu, Apr 23, 2020 at 09:32:37AM +0200, Richard Biener wrote: > > > On Thu, Apr 23, 2020 at 12:31 AM Jeff Law wrote: > > > > On Wed, 2020-04-22 at 15:50 -0500,

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Biener via Gcc-patches
On Thu, Apr 23, 2020 at 12:17 PM Segher Boessenkool wrote: > > On Thu, Apr 23, 2020 at 09:32:37AM +0200, Richard Biener wrote: > > On Thu, Apr 23, 2020 at 12:31 AM Jeff Law wrote: > > > On Wed, 2020-04-22 at 15:50 -0500, Segher Boessenkool wrote: > > > > > > In some ways it feels like it would be

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Segher Boessenkool
On Thu, Apr 23, 2020 at 09:32:37AM +0200, Richard Biener wrote: > On Thu, Apr 23, 2020 at 12:31 AM Jeff Law wrote: > > On Wed, 2020-04-22 at 15:50 -0500, Segher Boessenkool wrote: > > > > > In some ways it feels like it would be easier to resurrect RTL SSA :-) > > > > > > Why was RTL SSA abandoned

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-23 Thread Richard Biener via Gcc-patches
On Thu, Apr 23, 2020 at 12:31 AM Jeff Law wrote: > > On Wed, 2020-04-22 at 15:50 -0500, Segher Boessenkool wrote: > > > > > > In some ways it feels like it would be easier to resurrect RTL SSA :-) > > > > Why was RTL SSA abandoned? > > > > It might well work to keep everything in SSA form all the

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-22 Thread Jeff Law via Gcc-patches
On Wed, 2020-04-22 at 15:50 -0500, Segher Boessenkool wrote: > > > > In some ways it feels like it would be easier to resurrect RTL SSA :-) > > Why was RTL SSA abandoned? > > It might well work to keep everything in SSA form all the way to RA. > Hrm, that doesn't sound bad at all :-) > > (The P

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-22 Thread Segher Boessenkool
On Wed, Apr 22, 2020 at 11:58:38AM +0200, Richard Biener wrote: > On Wed, Apr 22, 2020 at 11:26 AM Richard Sandiford > wrote: > > Richard Biener via Gcc-patches writes: > > > On Mon, Apr 20, 2020 at 3:38 PM Segher Boessenkool > > > wrote: > > >> On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-22 Thread Richard Biener via Gcc-patches
On Wed, Apr 22, 2020 at 11:26 AM Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > On Mon, Apr 20, 2020 at 3:38 PM Segher Boessenkool > > wrote: > >> > >> Hi! > >> > >> On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard Biener wrote: > >> > On Fri, Apr 17, 2020 at 10:51 PM S

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-22 Thread Richard Sandiford
Richard Biener via Gcc-patches writes: > On Mon, Apr 20, 2020 at 3:38 PM Segher Boessenkool > wrote: >> >> Hi! >> >> On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard Biener wrote: >> > On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool >> > wrote: >> > > > Yeah well, but RTL is not in SSA form

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-20 Thread Richard Biener via Gcc-patches
On Mon, Apr 20, 2020 at 3:38 PM Segher Boessenkool wrote: > > Hi! > > On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard Biener wrote: > > On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool > > wrote: > > > > Yeah well, but RTL is not in SSA form > > > > > > "Webs" are not the *same* as SSA, in a

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-20 Thread Segher Boessenkool
Hi! On Mon, Apr 20, 2020 at 09:56:34AM +0200, Richard Biener wrote: > On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool > wrote: > > > Yeah well, but RTL is not in SSA form > > > > "Webs" are not the *same* as SSA, in a few crucial ways; but they serve > > similar purposes: they both make code

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-20 Thread Richard Biener via Gcc-patches
On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool wrote: > > On Fri, Apr 17, 2020 at 08:53:08AM +0200, Richard Biener wrote: > > On Thu, Apr 16, 2020 at 7:46 PM Segher Boessenkool > > wrote: > > > > > > On Thu, Apr 16, 2020 at 10:33:45AM +0200, Richard Biener wrote: > > > > On Wed, Apr 15, 2020

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-20 Thread Richard Biener via Gcc-patches
On Fri, Apr 17, 2020 at 10:51 PM Segher Boessenkool wrote: > > On Fri, Apr 17, 2020 at 08:53:08AM +0200, Richard Biener wrote: > > On Thu, Apr 16, 2020 at 7:46 PM Segher Boessenkool > > wrote: > > > > > > On Thu, Apr 16, 2020 at 10:33:45AM +0200, Richard Biener wrote: > > > > On Wed, Apr 15, 2020

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-17 Thread Segher Boessenkool
On Fri, Apr 17, 2020 at 08:53:08AM +0200, Richard Biener wrote: > On Thu, Apr 16, 2020 at 7:46 PM Segher Boessenkool > wrote: > > > > On Thu, Apr 16, 2020 at 10:33:45AM +0200, Richard Biener wrote: > > > On Wed, Apr 15, 2020 at 11:23 PM Segher Boessenkool > > > > On a general note, we shouldn't de

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-17 Thread Bill Schmidt via Gcc-patches
On 4/17/20 1:53 AM, Richard Biener wrote: Yeah well, but RTL is not in SSA form and there's no RTL IL verification in place to track degradation. And we even work in the opposite way when expanding to RTL from SSA, coalescing as much as we can ... Which is itself problematic, introducing unne

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-16 Thread Richard Biener via Gcc-patches
On Thu, Apr 16, 2020 at 7:46 PM Segher Boessenkool wrote: > > On Thu, Apr 16, 2020 at 10:33:45AM +0200, Richard Biener wrote: > > On Wed, Apr 15, 2020 at 11:23 PM Segher Boessenkool > > > On a general note, we shouldn't depend on some pass that may or may not > > > clean up the mess we make, when

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-16 Thread Segher Boessenkool
On Thu, Apr 16, 2020 at 10:33:45AM +0200, Richard Biener wrote: > On Wed, Apr 15, 2020 at 11:23 PM Segher Boessenkool > > On a general note, we shouldn't depend on some pass that may or may not > > clean up the mess we make, when we could just avoid making a mess in the > > first place. > > True -

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-16 Thread Richard Biener via Gcc-patches
On Wed, Apr 15, 2020 at 11:23 PM Segher Boessenkool wrote: > > Hi! > > On Wed, Apr 15, 2020 at 08:21:03AM +0200, Richard Biener wrote: > > On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches > > wrote: > > > As you may know, we have loop unroll pass in RTL which was introduced a > > > few

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-15 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: > Hi Jiufu, > > Just reviewing random things as I see them... > > On Wed, Apr 15, 2020 at 09:56:00AM +0800, Jiufu Guo wrote: >> This patch only supports simple loops: one exit edge with one major basic >> block. > > That is fine for a proof-of-concept, but will need fi

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-15 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: Hi, Thanks for all your comments! > Hi! > > On Wed, Apr 15, 2020 at 08:21:03AM +0200, Richard Biener wrote: >> On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches >> wrote: >> > As you may know, we have loop unroll pass in RTL which was introduced a few >> > ye

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-15 Thread Kewen.Lin via Gcc-patches
on 2020/4/15 下午2:21, Richard Biener via Gcc-patches wrote: > On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches > wrote: >> >> Hi, >> >> As you may know, we have loop unroll pass in RTL which was introduced a few >> years ago, and works for a long time. Currently, this unroller is using th

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-15 Thread Segher Boessenkool
Hi! On Wed, Apr 15, 2020 at 08:21:03AM +0200, Richard Biener wrote: > On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches > wrote: > > As you may know, we have loop unroll pass in RTL which was introduced a few > > years ago, and works for a long time. Currently, this unroller is using the

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-15 Thread Segher Boessenkool
Hi Jiufu, Just reviewing random things as I see them... On Wed, Apr 15, 2020 at 09:56:00AM +0800, Jiufu Guo wrote: > This patch only supports simple loops: one exit edge with one major basic > block. That is fine for a proof-of-concept, but will need fixing perhaps. > --- a/gcc/common.opt > ++

Re: [RFC] split pseudos during loop unrolling in RTL unroller

2020-04-14 Thread Richard Biener via Gcc-patches
On Wed, Apr 15, 2020 at 3:56 AM Jiufu Guo via Gcc-patches wrote: > > Hi, > > As you may know, we have loop unroll pass in RTL which was introduced a few > years ago, and works for a long time. Currently, this unroller is using the > pseudos in the original body, and then the pseudos are written m

[RFC] split pseudos during loop unrolling in RTL unroller

2020-04-14 Thread Jiufu Guo via Gcc-patches
Hi, As you may know, we have loop unroll pass in RTL which was introduced a few years ago, and works for a long time. Currently, this unroller is using the pseudos in the original body, and then the pseudos are written multiple times. It would be a good idea to create new pseudos for those dupli