[PATCH] Improve splitX passes management

Uros Bizjak ubizjak@gmail.com
Sat Feb 8 10:54:00 GMT 2020


On Fri, Feb 7, 2020 at 5:41 PM Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> On Thu, Feb 06, 2020 at 12:13:35PM +0100, Uros Bizjak wrote:
> > The names of split_before_sched2 ("split4") and split_before_regstack
> > ("split3") do not reflect their insertion point in the sequence of passes,
> > where split_before_regstack follows split_before_sched2. Reorder the code
> > and rename the passes to reflect the reality.
>
> Renaming them to other splitN doesn't help much :-/  Having stable names
> is more important (some archs actually use these names), I'd say.  But

True, this is why I took care to found and fix all references to
existing names. It is a simple substitution of old name with a new.

> it's hard to come up with shortish more meaningful names.
>
> There is no real need for the N in splitN to be in order, but sure it
> can be surprising otherwise.

I'm not familiar with tree passes, how the situation is handled there.
If a new instance of the same pass is inserted before existing pass,
does name of the existing pass get changed?

> > +bool
> > +pass_split_before_regstack::gate (function *)
> > +{
> > +#if HAVE_ATTR_length && defined (STACK_REGS)
> > +  /* If flow2 creates new instructions which need splitting
> > +     and scheduling after reload is not done, they might not be
> > +     split until final which doesn't allow splitting
> > +     if HAVE_ATTR_length.  */
> > +  return !enable_split_before_sched2 ();
> > +#else
> > +  return false;
> > +#endif
> > +}
>
> flow.c was deleted in 2006...  Is this split still needed at all?  If
> so, change the comment please?  :-)

Hm, I don't know in general, but x86 needs a late split at the point
where instantiated registers won't change in the insn. Mainly an
optimization, not correctness issue, but the split is needed to fix
some HW issues in the processor (please see comments in i386.md around
insn condition involving epilogue_completed flag.

As you suggested in the other mail, the issue with many late split
passes (passes 3-5) should be rewiewed, considering also other (e.g.
non-stack regs) targets.

Uros.



More information about the Gcc-patches mailing list