[PR46204] sel-sched: delete empty BBs more carefully

Vladimir Makarov vmakarov@redhat.com
Fri Nov 12 22:53:00 GMT 2010


On 11/10/2010 12:26 PM, Alexander Monakov wrote:
> Hello,
>
> When deleting an empty basic block, we redirect all incoming non-fallthrough
> edges to its successor.  However, we must also take care of the incoming
> fallthrough edge if the preceding basic block ends with a conditional jump to
> the next instruction (otherwise, by deleting the empty basic block we can
> remove the label that the jump refers to).  Fixed in maybe_tidy_empty_bb by
> trying to remove the jump or redirecting it to the successor of the empty block.
>
> The patch also removes recomputing of topological order in that function.  We
> can not invalidate it by moving an edge destination along an existing edge.  I
> have tried to add the corresponding assert, but it would be quite verbose,
> since the fallthrough edge may be a back edge, in which case it will look like
> we are invalidating toporder, even though we are legally creating a new back
> edge in the region, and will delete the old back edge soon (we can create
> multiple back edges that way, but we'd only care when pipelining, and we
> wouldn't have a fallthrough back edge then).
>
> Bootstrapped and regtested on ia64 with sel-sched enabled at -O2, also tested
> on x86-64 with sel-sched enabled for bootstrap.  OK?
>
As I understand g++.dg/torture/stackalign/throw-1.C is the test.

The patch looks ok for me.  Thank you for the patch, Alexander.




More information about the Gcc-patches mailing list