Re: [patch i386]: Combine memory and indirect jump

2014-06-23 Thread Richard Henderson
On 06/23/2014 09:22 AM, Jeff Law wrote: > On 06/23/14 08:32, Richard Biener wrote: >> Btw, there is now no DCE after peephole2? Is peephole2 expected to >> cleanup after itself? > There were cases where we wanted to change the insns we would output to fit > into the 4:1:1 issue model of the PPro,

Re: [patch i386]: Combine memory and indirect jump

2014-06-23 Thread Jeff Law
On 06/23/14 08:32, Richard Biener wrote: On Mon, Jun 23, 2014 at 4:13 PM, Richard Henderson wrote: On 06/20/2014 02:59 PM, Kai Tietz wrote: So I suggest following change of passes.def: Index: passes.def === --- passes.def (Revis

Re: [patch i386]: Combine memory and indirect jump

2014-06-23 Thread Richard Biener
On Mon, Jun 23, 2014 at 4:13 PM, Richard Henderson wrote: > On 06/20/2014 02:59 PM, Kai Tietz wrote: >> So I suggest following change of passes.def: >> >> Index: passes.def >> === >> --- passes.def (Revision 211850) >> +++ passes.def

Re: [patch i386]: Combine memory and indirect jump

2014-06-23 Thread Richard Henderson
On 06/20/2014 02:59 PM, Kai Tietz wrote: > So I suggest following change of passes.def: > > Index: passes.def > === > --- passes.def (Revision 211850) > +++ passes.def (Arbeitskopie) > @@ -384,7 +384,6 @@ along with GCC; see the fil

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Kai Tietz
2014-06-20 20:14 GMT+02:00 Jeff Law : > On 06/20/14 12:07, Kai Tietz wrote: >> >> 2014-06-20 19:55 GMT+02:00 Richard Henderson : >>> >>> On 06/20/2014 10:52 AM, Kai Tietz wrote: 2014-06-20 Kai Tietz PR target/39284 * passes.def (peephole2): Add second peephole2

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Jeff Law
On 06/20/14 12:07, Kai Tietz wrote: 2014-06-20 19:55 GMT+02:00 Richard Henderson : On 06/20/2014 10:52 AM, Kai Tietz wrote: 2014-06-20 Kai Tietz PR target/39284 * passes.def (peephole2): Add second peephole2 pass before split before sched2 pass. * config/i386/i386.md (pe

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Kai Tietz
2014-06-20 19:55 GMT+02:00 Richard Henderson : > On 06/20/2014 10:52 AM, Kai Tietz wrote: >> 2014-06-20 Kai Tietz >> >> PR target/39284 >> * passes.def (peephole2): Add second peephole2 pass before >> split before sched2 pass. >> * config/i386/i386.md (peehole2): To combine >>

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Richard Henderson
On 06/20/2014 10:52 AM, Kai Tietz wrote: > 2014-06-20 Kai Tietz > > PR target/39284 > * passes.def (peephole2): Add second peephole2 pass before > split before sched2 pass. > * config/i386/i386.md (peehole2): To combine > indirect jump with memory. > (split2): Likewise.

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Kai Tietz
So revert to use a second peephole2 pass before final split before sched2 pass. Ok for apply ChangeLog 2014-06-20 Kai Tietz PR target/39284 * passes.def (peephole2): Add second peephole2 pass before split before sched2 pass. * config/i386/i386.md (peehole2): To combine ind

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Kai Tietz
2014-06-20 19:23 GMT+02:00 Richard Henderson : > On 06/20/2014 08:56 AM, Kai Tietz wrote: >> +(define_split >> + [(set (match_operand:W 0 "register_operand") >> +(match_operand:W 1 "memory_operand")) >> + (set (pc) (match_dup 0))] >> + "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])"

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Richard Henderson
On 06/20/2014 08:56 AM, Kai Tietz wrote: > +(define_split > + [(set (match_operand:W 0 "register_operand") > +(match_operand:W 1 "memory_operand")) > + (set (pc) (match_dup 0))] > + "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])" > + [(set (pc) (match_dup 1))]) > + Huh? You can't

Re: [patch i386]: Combine memory and indirect jump

2014-06-20 Thread Kai Tietz
I tested variant to use additional the split pass for memory combining for indirect jumps. By this we don't need to add a second peephole2 pass. Other advantage of this version is that even for -O1 we do combining. ChangeLog 2014-06-20 Kai Tietz PR target/39284 * config/i386/i386.md

Re: [patch i386]: Combine memory and indirect jump

2014-06-18 Thread Jeff Law
On 06/17/14 14:35, Kai Tietz wrote: I just did retest my testcase with recent source. I can't reproduce this missed optimization before sched2 pass anymore. I moved second peephole2 pass just before split_before_sched2 and everything got caught. Let's go with this if your idea of using a define

Re: [patch i386]: Combine memory and indirect jump

2014-06-17 Thread Kai Tietz
2014-06-17 21:26 GMT+02:00 Jeff Law : > On 06/13/14 10:59, Kai Tietz wrote: >> >> 2014-06-13 17:58 GMT+02:00 Jeff Law : >>> >>> On 06/13/14 09:56, Richard Henderson wrote: On 06/13/2014 08:36 AM, Jeff Law wrote: > > > So you may have answered this already, but why can't t

Re: [patch i386]: Combine memory and indirect jump

2014-06-17 Thread Jeff Law
On 06/13/14 10:59, Kai Tietz wrote: 2014-06-13 17:58 GMT+02:00 Jeff Law : On 06/13/14 09:56, Richard Henderson wrote: On 06/13/2014 08:36 AM, Jeff Law wrote: So you may have answered this already, but why can't this be a combiner pattern? Until pass_duplicate_computed_gotos, we (intention

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Segher Boessenkool
> >My concern is that peepholes are rather fragile, so imho it is not > >inconceivable that some target will generate wrong code when you add > >an extra (later) peephole pass. Of course, we are in stage1. > peephole2 is significantly robust than the original peephole pass; > largely because pee

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Kai Tietz
2014-06-13 17:58 GMT+02:00 Jeff Law : > On 06/13/14 09:56, Richard Henderson wrote: >> >> On 06/13/2014 08:36 AM, Jeff Law wrote: >>> >>> So you may have answered this already, but why can't this be a combiner >>> pattern? >> >> >> Until pass_duplicate_computed_gotos, we (intentionally) have a sing

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Jeff Law
On 06/13/14 09:56, Richard Henderson wrote: On 06/13/2014 08:36 AM, Jeff Law wrote: So you may have answered this already, but why can't this be a combiner pattern? Until pass_duplicate_computed_gotos, we (intentionally) have a single indirect branch in the entire function. This vastly reduce

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Richard Henderson
On 06/13/2014 08:36 AM, Jeff Law wrote: > So you may have answered this already, but why can't this be a combiner > pattern? Until pass_duplicate_computed_gotos, we (intentionally) have a single indirect branch in the entire function. This vastly reduces the size of the CFG. Peep2 is currently

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Jeff Law
On 06/12/14 10:21, Kai Tietz wrote: Hello, I updated i386.md part of the patch. Initial patch included handling of blockage, which is obviously superflous. Additionally I merged 32-bit and 64-bit peephole2 versions by using mode-specifier W. ChangeLog 2014-06-12 Kai Tietz * config/i3

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Jeff Law
On 06/12/14 15:06, Segher Boessenkool wrote: Will that work on other targets? Well, this is the only point I am a bit concerned too. In general I wouldn't expect here any issues to run peephole after scheduling, as peephole doesn't do anything a new run of ira/lra would require. My concern

Re: [patch i386]: Combine memory and indirect jump

2014-06-13 Thread Kai Tietz
2014-06-12 23:46 GMT+02:00 David Wohlferd : > > On 6/12/2014 9:21 AM, Kai Tietz wrote: >> >> with addition of adding a second peephole2 pass after sched2 pass, I >> was able to get some improvement for PR target/39284. I think by this >> addition we can close bug as fixed. >> Additionally addition

Re: [patch i386]: Combine memory and indirect jump

2014-06-12 Thread David Wohlferd
On 6/12/2014 9:21 AM, Kai Tietz wrote: with addition of adding a second peephole2 pass after sched2 pass, I was able to get some improvement for PR target/39284. I think by this addition we can close bug as fixed. Additionally additional peephole2 pass shows better results for PR target/51840 t

Re: [patch i386]: Combine memory and indirect jump

2014-06-12 Thread Segher Boessenkool
> > Will that work on other targets? > Well, this is the only point I am a bit concerned too. In general I > wouldn't expect here any issues to run peephole after scheduling, as > peephole doesn't do anything a new run of ira/lra would require. My concern is that peepholes are rather fragile, so

Re: [patch i386]: Combine memory and indirect jump

2014-06-12 Thread Kai Tietz
2014-06-12 20:52 GMT+02:00 Segher Boessenkool : > On Thu, Jun 12, 2014 at 06:21:32PM +0200, Kai Tietz wrote: >> with addition of adding a second peephole2 pass after sched2 pass, I >> was able to get some improvement for PR target/39284. I think by this >> addition we can close bug as fixed. >> Ad

Re: [patch i386]: Combine memory and indirect jump

2014-06-12 Thread Segher Boessenkool
On Thu, Jun 12, 2014 at 06:21:32PM +0200, Kai Tietz wrote: > with addition of adding a second peephole2 pass after sched2 pass, I > was able to get some improvement for PR target/39284. I think by this > addition we can close bug as fixed. > Additionally additional peephole2 pass shows better resu

Re: [patch i386]: Combine memory and indirect jump

2014-06-12 Thread Kai Tietz
Hello, I updated i386.md part of the patch. Initial patch included handling of blockage, which is obviously superflous. Additionally I merged 32-bit and 64-bit peephole2 versions by using mode-specifier W. ChangeLog 2014-06-12 Kai Tietz * config/i386/i386.md (peehole2): To combine i

Re: [patch i386]: Combine memory and indirect jump

2014-06-11 Thread Kai Tietz
2014-06-11 11:57 GMT+02:00 Steven Bosscher : > On Wed, Jun 11, 2014 at 10:32 AM, Kai Tietz wrote: >> this patch adds simple combining of indirect-jumps on memory-address. >> This patch is pretty similar to sibcall-combing. >> ChangeLog >> >> 2014-06-11 Kai Tietz >> >> * config/i386/i386.md (

Re: [patch i386]: Combine memory and indirect jump

2014-06-11 Thread Steven Bosscher
On Wed, Jun 11, 2014 at 10:32 AM, Kai Tietz wrote: > this patch adds simple combining of indirect-jumps on memory-address. > This patch is pretty similar to sibcall-combing. > ChangeLog > > 2014-06-11 Kai Tietz > > * config/i386/i386.md (peehole2): To combine > indirect jump with memory.

[patch i386]: Combine memory and indirect jump

2014-06-11 Thread Kai Tietz
Hello, this patch adds simple combining of indirect-jumps on memory-address. This patch is pretty similar to sibcall-combing. ChangeLog 2014-06-11 Kai Tietz * config/i386/i386.md (peehole2): To combine indirect jump with memory. 2014-06-11 Kai Tietz * gcc.target/i386/indjmp-1