From: Jeff Law <law@redhat.com>
To: Bernd Schmidt <bernds@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Emit more REG_EQUIV notes for function args (PR42235)
Date: Wed, 14 Jul 2010 18:54:00 -0000 [thread overview]
Message-ID: <4C3E07EF.1030306@redhat.com> (raw)
In-Reply-To: <4C3D9C06.60901@codesourcery.com>
On 07/14/10 05:14, Bernd Schmidt wrote:
> When moving arguments into pseudos, we are being very careful not to
> emit any instructions that could possibly clobber other argument
> registers. Currently, we generate unnecessarily complicated sequences
> of code for simple zero or sign extensions.
>
> With this patch, we check can_extend_p and the necessary predicates to
> see if an extend insn is available for the conversion we have to do.
Right, but what guarantee do we have that the conversion insn doesn't
clobber a function argument register? ISTM that to be safe you
actually have to scan the insns created by gen_extend_insn to ensure
they don't clobber something important.
I'm not an expert on what ports do these days, but I did work on a port
(mn10200) where conversion "insns" where implemented as special function
calls under the hood. I don't recall if we allowed those special
function calls to have visible side effects, but if they did, they'd
show up as clobbers/uses attached to the normal conversion insn. Of
course the mn102 is dead, but I think it's method for implementing
conversions was valid and if another port were to do something similar
it would likely not interact well with your change.
> If
> so, we emit the insn directly, and create a REG_EQUIV note of the form
> (sign_extend (mem)).
Creating more REG_EQUIVs seems like a good idea to me.
> Reload can't really do anything with these yet,
> but there's an optimization in the register allocator to move argument
> loads directly before their use if there's only one use. On Thumb-2
> this happens already, we seem to generate better code than before.
> Unfortunately Thumb-1, which the PR is about, has some other problems
> which I'll try to fix later.
>
In theory, given the REG_EQUIV note we ought to get an entry in
reg_equiv_mem, which the code I'm working on knows it can use instead of
shoving the pseudo into a stack slot. Effectively, my code will
rematerialize the argument from the equivalent memory location
regardless of the number of uses.
Jeff
next prev parent reply other threads:[~2010-07-14 18:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 11:14 Bernd Schmidt
2010-07-14 18:54 ` Jeff Law [this message]
2010-07-14 21:30 ` Bernd Schmidt
2010-07-14 22:28 ` Jeff Law
2010-07-15 17:14 ` Bernd Schmidt
2010-07-15 21:26 ` Jeff Law
2010-07-19 9:55 ` Bernd Schmidt
2010-07-19 16:51 ` Jeff Law
2010-07-19 16:53 ` Bernd Schmidt
2010-07-19 16:59 ` Richard Henderson
2010-07-19 17:09 ` Jeff Law
2010-07-19 19:06 ` John David Anglin
2010-07-21 22:53 ` Bernd Schmidt
2010-07-14 21:48 ` Bernd Schmidt
2010-07-14 22:22 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C3E07EF.1030306@redhat.com \
--to=law@redhat.com \
--cc=bernds@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).