Patchwork Run peephole2 after sched2

login
register
mail settings
Submitter Moore, Catherine
Date July 19, 2012, 2:50 p.m.
Message ID <FD3DCEAC5B03E9408544A1E416F1124211F9CBE9@NA-MBX-04.mgc.mentorg.com>
Download mbox | patch
Permalink /patch/171958/
State New
Headers show

Comments

Moore, Catherine - July 19, 2012, 2:50 p.m.
Hi,

The microMIPS port benefits from an additional peephole2 pass.  Sched2 exposes some opportunities to recognize the movep instruction.
Does  this look okay to commit?

Thanks,
Catherine

2012-07-19  Catherine Moore  <clm@codesourcery.com>
	         Chao-ying Fu <fu@mips.com>

	* passes.c (init_optimization_passes): Run peephole2 after sched2.
Steven Bosscher - July 19, 2012, 4:01 p.m.
On Thu, Jul 19, 2012 at 4:50 PM, Moore, Catherine
<Catherine_Moore@mentor.com> wrote:
> Hi,
>
> The microMIPS port benefits from an additional peephole2 pass.  Sched2 exposes some opportunities to recognize the movep instruction.
> Does  this look okay to commit?

Not really. The purpose of peephole2 was to do peephole optimizations
before *final* scheduling. Maybe this patch works for MIPS, but you
could seriously ruin performance on machines where scheduling matters.
(And even on MIPS, how do you handle pipeline hazards?)

Ciao!
Steven

Patch

Index: passes.c
===================================================================
--- passes.c    (revision 189440)
+++ passes.c    (working copy)
@@ -1589,6 +1589,7 @@  init_optimization_passes (void)
          NEXT_PASS (pass_leaf_regs);
          NEXT_PASS (pass_split_before_sched2);
          NEXT_PASS (pass_sched2);
+         NEXT_PASS (pass_peephole2);
          NEXT_PASS (pass_stack_regs);
            {
              struct opt_pass **p = &pass_stack_regs.pass.sub;