From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Marc Glisse <marc.glisse@inria.fr>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: update address taken: don't drop clobbers
Date: Thu, 16 Oct 2014 11:20:00 -0000 [thread overview]
Message-ID: <CAFiYyc27PjA1A_DZnfWGzU2y10Lp3rEoZs1m7hknq1eJDOqK_Q@mail.gmail.com> (raw)
In-Reply-To: <543E9BED.4070905@redhat.com>
On Wed, Oct 15, 2014 at 6:08 PM, Jeff Law <law@redhat.com> wrote:
> On 10/15/14 08:35, Marc Glisse wrote:
>>>
>>>
>>> Would that extra pass be acceptable?
Ugh, rather not. We have too many passes ;)
>>> Otherwise, what do you think should be responsible for cleaning up the
>>> dead assignments?
>>
>>
>> Does anyone have an opinion on which side needs to be improved? As a
>> reminder:
>>
>> - we have a va_list with its address taken by va_start/va_end.
>> - fab lowers va_start/va_end and the list doesn't have its address taken
>> anymore.
>> - update_address_taken replaces the clobber: list =v {}; with an
>> assignment of an undefined value: list_6 = list_2(D);
>> - uninit warns about this.
>>
>> Some possible directions:
>> - "prematurely" optimize in update_address_taken so we don't generate
>> the useless assignment.
>> - add a dce pass before uninit.
>
> I tend to land on the side of minimizing false positives, so the comment
> about PR18501 is a "don't care" to me. If the optimizers remove a dead
> assignment and we no longer warn about a potential uninitialized use in the
> dead assignment, then I consider that good. Not everyone agrees with that
> way of thinking, obviously.
>
> So my inclination would be to evaluate independent of the pr18501 issues.
> ie, what's the compile-time cost vs runtime benefit of running DCE here.
> I'm guessing there's little runtime benefit for this particular case.
>
> So my next line of thinking would be can we arrange to conditionally run
> DCE? ie, have update_address_taken signal that it did something that has a
> reasonable chance of exposing dead code and only run DCE in that case.
> Obviously this only helps if it rarely signals :-) I don't think we have
> any infrastructure for this right now.
>
> Finally I'd look at how difficult it would be to have update_address_taken
> cleanup after itself. If the LHS is in SSA form, then if we find it has no
> uses, can we just remove the assignment completely?
It doesn't even know that it has no uses (the variable still needs to be
written into SSA form). OTOH it is a missed DSE opportunity before
update-address-taken?
As of premature optimization - into-SSA could notice it created SSA
names with no uses and trigger a fast DCE.
Btw, I wonder what this odd folding of variadic builtins is about, and why
it is not done in the stdarg pass (and only there), which would be earlier.
Richard.
> jeff
next prev parent reply other threads:[~2014-10-16 11:20 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-28 22:33 Marc Glisse
2014-06-29 23:38 ` SRA: " Marc Glisse
2014-07-07 8:56 ` Richard Biener
2014-07-07 9:32 ` Marc Glisse
2014-07-07 18:32 ` Richard Biener
2014-07-07 20:15 ` Marc Glisse
2014-07-07 16:59 ` Jeff Law
2014-07-10 14:55 ` Richard Biener
2014-07-10 15:01 ` Jakub Jelinek
2014-06-30 19:31 ` update address taken: " Jeff Law
2014-07-06 14:24 ` Marc Glisse
2014-07-06 14:54 ` pinskia
2014-07-06 15:01 ` Marc Glisse
2014-07-07 10:21 ` Richard Biener
2014-07-07 17:20 ` Jeff Law
2014-07-08 13:31 ` Marc Glisse
2014-07-10 15:10 ` Richard Biener
2014-07-10 15:49 ` Michael Matz
2014-07-10 18:23 ` Jeff Law
2014-07-11 8:10 ` Richard Biener
2014-07-11 8:14 ` Richard Biener
2014-07-11 12:06 ` Michael Matz
2014-07-11 17:16 ` Jeff Law
2014-07-12 6:15 ` Marc Glisse
2014-07-24 13:06 ` Richard Biener
2014-07-27 11:53 ` Marc Glisse
2014-07-27 18:01 ` Marc Glisse
2014-09-07 15:28 ` Marc Glisse
2014-10-15 14:36 ` Marc Glisse
2014-10-15 16:12 ` Jeff Law
2014-10-16 11:20 ` Richard Biener [this message]
2014-10-16 14:11 ` Marc Glisse
2014-10-16 14:34 ` Richard Biener
2014-10-16 17:29 ` Jeff Law
2014-10-16 17:58 ` Richard Biener
2014-10-16 18:37 ` Jeff Law
2014-10-17 20:46 ` Marc Glisse
2014-10-24 20:22 ` Jeff Law
2014-10-25 8:06 ` Marc Glisse
2014-10-31 21:06 ` Jeff Law
2014-10-25 17:14 ` Marc Glisse
2014-10-31 11:12 ` Richard Biener
2014-11-02 10:34 ` Marc Glisse
2014-11-03 9:06 ` Richard Biener
2014-10-31 21:16 ` Jeff Law
2014-10-16 17:23 ` Jeff Law
2014-10-18 22:23 ` Marc Glisse
2014-10-24 20:19 ` 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=CAFiYyc27PjA1A_DZnfWGzU2y10Lp3rEoZs1m7hknq1eJDOqK_Q@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=marc.glisse@inria.fr \
/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).