This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Initial shrink-wrapping patch
- From: Richard Henderson <rth at redhat dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, richard dot sandiford at linaro dot org
- Date: Tue, 04 Oct 2011 15:29:59 -0700
- Subject: Re: Initial shrink-wrapping patch
- References: <4E5E7342.9050103@codesourcery.com> <g462lcbc22.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4E6E9857.50600@t-online.de> <g4ehzklu0r.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4E6F37D9.9000108@t-online.de> <g4pqj4k702.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4E6F4B90.2050408@codesourcery.com> <g4hb4gk2xa.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4E6F786E.6080407@codesourcery.com> <4E712FD6.5030109@redhat.com> <4E8239ED.9020004@codesourcery.com> <4E85F395.3030006@redhat.com> <4E8B8469.2090605@codesourcery.com>
On 10/04/2011 03:10 PM, Bernd Schmidt wrote:
> * doc/invoke.texi (-fshrink-wrap): Document.
> * opts.c (default_options_table): Add it.
> * common.opt (fshrink-wrap): Add.
> * function.c (emit_return_into_block): Remove useless declaration.
> (record_hard_reg_uses_1, record_hard_reg_uses, frame_required_for_rtx,
> requires_stack_frame_p, gen_return_pattern): New static functions.
> (emit_return_into_block): New arg simple_p. All callers changed.
> Use gen_return_pattern.
> (thread_prologue_and_epilogue_insns): Implement shrink-wrapping.
> * config/i386/i386.md (return): Expand into a simple_return.
> (simple_return): New expander):
> (simple_return_internal, simple_return_internal_long,
> simple_return_pop_internal_long, simple_return_indirect_internal):
> Renamed from return_internal, return_internal_long,
> return_pop_internal_long and return_indirect_internal; changed to use
> simple_return.
> * config/i386/i386.c (ix86_expand_epilogue): Adjust to expand
> simple returns.
> (ix86_pad_returns): Likewise.
> * function.h (struct rtl_data): Add member shrink_wrapped.
> * cfgcleanup.c (outgoing_edges_match): If shrink-wrapped, edges that
> are not jumps or sibcalls can't be compared.
>
> * gcc.target/i386/sw-1.c: New test.
Ok.
As a followup, I think this option needs to be disabled for profiling
and profile_after_prologue. Should be a mere matter of frobbing the
options at startup.
r~