public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: Steven Bosscher <stevenb.gcc@gmail.com>
Cc: Jan Hubicka <hubicka@ucw.cz>, gcc-patches@gcc.gnu.org
Subject: Re: Fix twolf -funroll-loops -O3 miscompilation (a semi-latent web.c bug)
Date: Mon, 15 Oct 2012 12:28:00 -0000	[thread overview]
Message-ID: <CAHFMJ7sMWmv=DWhqbVRFzVip47Od-qJEpgVYL+JyAmpiPefK=A@mail.gmail.com> (raw)
In-Reply-To: <CABu31nPj3bokE9oywDwuLPTPjwe7vYpaThQrfBK0WgnQUm8naw@mail.gmail.com>

Il 15/10/2012 10:37, Steven Bosscher ha scritto:
>> I prefer to declare the notes invalid and drop the notes.
> Then, afaic, our only option is to drop them all in web, as per attached patch.
>
> I strongly disagree with this approach though. It destroys information
> that is correct, that we had before DF_RD_PRUNE_DEAD_DEFS, that we can
> update, and that helps with optimization. With renaming these notes
> are valid, and do not refer to dead regs

I agree it is bad.  But I do not understand the last sentence: I
suppose you mean that _without_ renaming these notes are valid, on the
other hand it is normal that some of the notes will be dropped if you
shorten live ranges.

Without removing all of the notes you can do something like this:

- drop the deferred rescanning from web.c.  Instead, make replace_ref
return a bool and call df_insn_rescan manually from web_main.

- attribute new registers to webs in a separate pass that happens
before rewriting, and compute a special version of LR_IN/LR_OUT that
uses the rewritten registers.

- process instructions in reverse order; before starting the visit of
a basic block, initialize the local LR bitmap with the rewritten
LR_OUT of the previous step

- after rewriting and scanning each statement, simulate liveness using
the new defs and uses.

- after rewriting each statement, look for EQ_USES referring to
registers that are dead just before the statement, and delete
REG_EQUAL notes if this is the case

Paolo

> This whole discussion about notes being dead has gone in completely
> the wrong direction. With renaming these notes are valid, and do not
> refer to dead regs. Perhaps you could be convinced if you look at
> Honza's test case with the patch of r192413 reverted.
> The test case still fails with --param max-unroll-times=3, that makes
> visualizing the problem easier.

  parent reply	other threads:[~2012-10-15 11:50 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 20:14 Jan Hubicka
2012-10-12 20:36 ` Markus Trippelsdorf
2012-10-12 20:44 ` Steven Bosscher
2012-10-12 21:16   ` Jan Hubicka
2012-10-12 21:19     ` Steven Bosscher
2012-10-12 21:31       ` Jan Hubicka
2012-10-12 22:41         ` Steven Bosscher
2012-10-14  9:13           ` Paolo Bonzini
2012-10-14 21:27             ` Steven Bosscher
2012-10-14 21:35               ` Eric Botcazou
2012-10-14 21:45                 ` Steven Bosscher
2012-10-15  8:14               ` Paolo Bonzini
2012-10-15  8:23                 ` Steven Bosscher
2012-10-15  8:35                   ` Paolo Bonzini
2012-10-15  8:38                     ` Steven Bosscher
2012-10-15 10:49                       ` Steven Bosscher
2012-10-15 12:28                       ` Paolo Bonzini [this message]
2012-10-15 13:19                         ` Steven Bosscher
2012-10-15 13:29                           ` Paolo Bonzini
2012-10-15 13:49                             ` Steven Bosscher
2012-10-16 10:35                               ` Steven Bosscher
2012-10-16 11:05                                 ` Steven Bosscher
2012-10-16 11:42                                   ` Paolo Bonzini
2012-10-16 22:57                                     ` Steven Bosscher
2012-10-19  5:14                                       ` Bin.Cheng
2012-10-12 21:05 ` Steven Bosscher
2012-11-18 23:15 Dominique Dhumieres
2012-11-19  9:50 ` Steven Bosscher
2012-11-19 11:27   ` Eric Botcazou
2012-11-19 20:35     ` Steven Bosscher
2012-11-19 21:20       ` Steven Bosscher
2012-11-19 21:52         ` Eric Botcazou
2012-11-19 22:03           ` Steven Bosscher
2012-11-19 22:44             ` Eric Botcazou
2012-11-19 22:48               ` Steven Bosscher
2012-11-23 22:46                 ` Steven Bosscher
2012-11-24  1:10                   ` Steven Bosscher
2012-11-25 20:44                     ` Steven Bosscher
2012-11-25 22:38                       ` Steven Bosscher
2012-11-26 14:38                         ` Dominique Dhumieres
2012-11-26 15:46                           ` Steven Bosscher
2012-11-27  9:58                         ` Eric Botcazou
2012-11-27 10:35                           ` Steven Bosscher
2012-11-27 12:01                             ` Steven Bosscher
2012-11-27 12:29                               ` Steven Bosscher
2012-11-27 13:04                                 ` Steven Bosscher
2012-11-27 14:25                                   ` Dominique Dhumieres
2012-11-27 14:49                                     ` Steven Bosscher
2012-11-27 13:48                                 ` Dominique Dhumieres
2012-11-27 14:33                               ` Paolo Bonzini
2012-11-27 16:59                                 ` Eric Botcazou
2012-11-27 23:29                                   ` Steven Bosscher
2012-11-27 23:50                                     ` Eric Botcazou
2012-11-27 23:54                                       ` Steven Bosscher
2012-11-27 23:59                                         ` Steven Bosscher
2012-11-28  0:43                                           ` Steven Bosscher
2012-11-28  7:46                                             ` Eric Botcazou
2012-11-28 15:57                                               ` Steven Bosscher
2012-11-28 22:12                                                 ` Eric Botcazou
2012-11-28 23:54                                                   ` Steven Bosscher
2012-12-01 14:57                                                     ` Eric Botcazou
2012-12-01 16:45                                                       ` Steven Bosscher
2012-12-03 18:26                                                         ` Eric Botcazou
2012-12-03 20:20                                                           ` Steven Bosscher
2012-12-03 21:12                                                             ` Eric Botcazou
2012-12-03 23:28                                                             ` Steven Bosscher
2012-12-03 20:15                                                       ` Paolo Bonzini
2012-11-19 21:29       ` Eric Botcazou

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='CAHFMJ7sMWmv=DWhqbVRFzVip47Od-qJEpgVYL+JyAmpiPefK=A@mail.gmail.com' \
    --to=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=stevenb.gcc@gmail.com \
    /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).