This is the mail archive of the
mailing list for the GCC project.
Re: limiting call clobbered registers for library functions
- From: Joern Rennecke <joern dot rennecke at embecosm dot com>
- To: pshortis at dataworx dot com dot au
- Cc: Yury Gribov <y dot gribov at samsung dot com>, Matthew Fortune <Matthew dot Fortune at imgtec dot com>, Richard Henderson <rth at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Feb 2015 23:14:53 +0000
- Subject: Re: limiting call clobbered registers for library functions
- Authentication-results: sourceware.org; auth=none
- References: <54CA069F dot 1060203 at dataworx dot com dot au> <54CA6E9D dot 6050202 at redhat dot com> <54CB35A6 dot 5090408 at samsung dot com> <6D39441BF12EF246A7ABCE6654B0235320FBD360 at LEMAIL01 dot le dot imgtec dot org> <54CF3B76 dot 5010106 at samsung dot com> <54CFF22C dot 70301 at dataworx dot com dot au>
On 2 February 2015 at 21:54, Paul Shortis <firstname.lastname@example.org> wrote:
> I could have avoided the expander and used a single instruction pattern for
> a)b)c) if if could have found a way to have alternative dependent clobbers
> in an instruction pattern. I investigated attributes but couldn't see how I
> would be able to achieve what I needed. Also tried clobber (match_dup 2) but
> when one of the alternatives has a constant for operands the clobber is
> accepted silently by the .md compiler but doesn't actually clobber the
> non-constant alternatives.
You can clobber one or more match_scratch with suitable constraint alternatives
and let the register allocator / reload reserve the hard registers.
Well, not really for cc, you'll just have to say you clobber it, and
split away the
unused clobber post-reload.
That will not really give you less source code, but more uniform patterns
prior to register allocation. That gives the rtl optimizers a better
handle on the code.
The effect is even more pronounced when you replace all hard register usage with
pseudo register usage and appropriate constraints.