public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/62217] [4.9/5 Regression] DOM confuses complete unrolling which in turn causes VRP to warn
Date: Fri, 13 Feb 2015 09:16:00 -0000	[thread overview]
Message-ID: <bug-62217-4-jRHijOUJYO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-62217-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62217

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #5)
> Kirill, you are correct WRT propagation of "b" for "i".  Prior to DOM1 we
> have:
> 
> ;;   basic block 3, loop depth 1, count 0, freq 9100, maybe hot
> ;;    prev block 2, next block 4, flags: (NEW, REACHABLE)
> ;;    pred:       7 [91.0%]  (TRUE_VALUE,EXECUTABLE)
>   if (i_1 == b_6(D))
>     goto <bb 4>;
>   else
>     goto <bb 5>;
> ;;    succ:       4 [0.0%]  (TRUE_VALUE,EXECUTABLE)
> ;;                5 [100.0%]  (FALSE_VALUE,EXECUTABLE)
> 
> ;;   basic block 4, loop depth 1, count 0, freq 2, maybe hot
> ;;    prev block 3, next block 5, flags: (NEW, REACHABLE)
> ;;    pred:       3 [0.0%]  (TRUE_VALUE,EXECUTABLE)
>   g_x[i_1] = *x1_7(D);
>   goto <bb 6>;
> ;;    succ:       6 [100.0%]  (FALLTHRU,EXECUTABLE)
> 
> ;;   basic block 5, loop depth 1, count 0, freq 9098, maybe hot
> ;;    prev block 4, next block 6, flags: (NEW, REACHABLE)
> ;;    pred:       3 [100.0%]  (FALSE_VALUE,EXECUTABLE)
>   g_x[i_1] = *x2_9(D);
> ;;    succ:       6 [100.0%]  (FALLTHRU,EXECUTABLE)
> 
> 
> DOM records that i_1 and b_6 are equivalent on the edge bb3->bb4.  So in bb4
> it replaces i_1 with b_6.  Presumably that's causing problems downstream in
> the optimization pipeline.  The easiest way to think about this is we record
> that i_1 can be legitimately replaced with b_6 in that context.  We could
> just have easily recorded that b_6 can be replaced with i_1.
> 
> I don't think we have any heuristics for which of those two equivalences to
> record, it's strictly based on the order of appearance (which is likely
> determined elsewhere by canonicalization rules).
> 
> If you want to propose some heuristics, I'm all ears.   One might be to put
> the object with the least number of references on the lhs.  THe idea would
> be to try and ultimately get that use count to 0/1 which may allow that
> object to die at the comparison.  There may be some reasonable heuristic
> around loop depth of the names as well.    ie, do we want to replace uses of
> a non-loop object with a loop object or vice versa?
> 
> Anyway, open to suggestions here...

The rule is simple - we should always replace with the more dominating
definition because that's what value-numbering would do to be able to
make the other defs unused.


  parent reply	other threads:[~2015-02-13  9:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 13:31 [Bug tree-optimization/62217] New: Extra iteration peeled during cunroll. Makes VRP warn kyukhin at gcc dot gnu.org
2014-08-22  4:41 ` [Bug tree-optimization/62217] " pinskia at gcc dot gnu.org
2014-08-22  7:00 ` pinskia at gcc dot gnu.org
2014-08-22  7:45 ` [Bug tree-optimization/62217] DOM confuses complete unrolling which in turn causes VRP to warn kyukhin at gcc dot gnu.org
2014-08-26 11:16 ` [Bug tree-optimization/62217] [4.9/5 Regression] " rguenth at gcc dot gnu.org
2014-10-30 10:39 ` jakub at gcc dot gnu.org
2014-11-24 13:07 ` rguenth at gcc dot gnu.org
2015-02-12 22:42 ` law at redhat dot com
2015-02-13  9:16 ` rguenth at gcc dot gnu.org [this message]
2015-02-13 23:29 ` law at redhat dot com
2015-02-16  8:55 ` rguenther at suse dot de
2015-02-16 19:05 ` law at redhat dot com
2015-02-17  9:44 ` rguenther at suse dot de
2015-02-17 14:31 ` rguenth at gcc dot gnu.org
2015-02-17 15:02 ` rguenth at gcc dot gnu.org
2015-02-17 15:40 ` law at redhat dot com
2015-02-17 20:01 ` law at redhat dot com
2015-02-18  9:49 ` [Bug tree-optimization/62217] [4.9 " rguenth at gcc dot gnu.org
2015-02-18  9:49 ` [Bug tree-optimization/62217] [4.9/5 " rguenth at gcc dot gnu.org
2015-06-26 19:59 ` [Bug tree-optimization/62217] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:29 ` jakub at gcc dot gnu.org

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=bug-62217-4-jRHijOUJYO@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).