]> git.ipfire.org Git - thirdparty/gcc.git/commit
shrink-wrap: Handle multiple predecessors of prologue
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2015 20:50:38 +0000 (20:50 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Sep 2015 20:50:38 +0000 (20:50 +0000)
commitf6378b86af8c7d71e06638d7be04f94fd4422ef4
tree6c4b9f01b10be2f4390fa87e4680491acee3ba07
parent2c4f7dadbfe6292262e2a6f71997f371539d6cca
shrink-wrap: Handle multiple predecessors of prologue

The caller of try_shrink_wrapping wants to be returned a single edge to
put the prologue on.  To make that work even if there are multiple edges
(all pointing to the PRO block) that need the prologue, add a new block
that becomes the destination of all such edges, and then jumps to PRO.

In the general case, some edges to PRO will need to be redirected, and
not all edges *can* be redirected.  This adds a can_get_prologue function
that detects such cases.  This then happily can also handle the "prologue
clobbers some reg that is live on the edge we want to insert it on" case.

Not all EDGE_CROSSING edges can be redirected, so handle those the same
as EDGE_COMPLEX edges.

2015-09-22  Segher Boessenkool  <segher@kernel.crashing.org>

* function.c (thread_prologue_and_epilogue_insns): Delete
orig_entry_edge argument to try_shrink_wrapping.
* shrink-wrap.c (can_get_prologue): New function.
(can_dup_for_shrink_wrapping): Also handle EDGE_CROSSING.
(try_shrink_wrapping): Delete orig_entry_edge argument.  Use
can_get_prologue where needed.  Remove code that finds a single
edge for the prologue.  Remove code that tests if any reg clobbered
by the prologue is live on the prologue edge.  Remove code that finds
the new prologue edge after duplicating blocks.  Make a new prologue
block and edge.
* shrink-wrap.h (try_shrink_wrapping): Delete orig_entry_edge argument.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228022 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/function.c
gcc/shrink-wrap.c
gcc/shrink-wrap.h