preserve more debug stmts in gimple jump threading

Richard Biener richard.guenther@gmail.com
Thu May 16 18:47:00 GMT 2019


On Thu, May 16, 2019 at 6:14 PM Jeff Law <law@redhat.com> wrote:
>
> On 5/15/19 3:03 PM, Alexandre Oliva wrote:
> > On May 15, 2019, Richard Biener <richard.guenther@gmail.com> wrote:
> >
> >> On Wed, May 15, 2019 at 10:20 AM Alexandre Oliva <aoliva@redhat.com> wrote:
> >>>
> >>> Gimple jump threading does not duplicate forwarder blocks that might
> >>> be present before or after the copied block.
> >
> >> Empty forwarder blocks I presume?
> >
> > Empty except for debug stmts and possibly a final conditional jump that,
> > in the threading path, becomes unconditional.
> Right.  The tree-ssa-threadupate code all pre-dates the SEME copier
> which is a *much* better way to handle duplicating the region.
>
> Initially we allowed only one block with side effects in the jump
> threading path.  That's all we really knew how to do correctly.  We
> extended that to ignore forwarders at some point since they didn't need
> to be copied -- you just need to know where the forwarder block will go.
>
> We later added the ability to copy a second block with side effects in
> the jump threading path.
>
> But I'd really like to just remove tree-ssa-threadupate.c.  It's
> horribly convoluted due to old requirements.  I'm confident we could use
> the SEME copier to handle all the existing cases in a much simpler fashion.

Not sure if that's the best infrastructure to use (it cannot copy a path
crossing a backedge).  tracer does the duplicating incrementally
for example.  Technically the duplication isn't difficult but some
simplification on the fly would be nice (like actually merging the
blocks and propagating out PHIs and constants).

Eventually I'll find cycles to implement sth like this in a greedy
fashion for loop unrolling.

Richard.

>
>
> Jeff



More information about the Gcc-patches mailing list