All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [Bug 90887] PhiMovesPass in register allocator broken
Date: Sun, 28 Jun 2015 06:17:58 +0000	[thread overview]
Message-ID: <bug-90887-8800-oaNAxwKWzx@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-90887-8800-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>


[-- Attachment #1.1: Type: text/plain, Size: 2027 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=90887

--- Comment #14 from Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org> ---
OK, so among other changes, commit e43a3a66 had the following diff:

@@ -312,23 +337,26 @@ RegAlloc::PhiMovesPass::visit(BasicBlock *bb)
    Instruction *phi, *mov;
    BasicBlock *pb, *pn;

+   std::stack<BasicBlock *> stack;
+
    for (Graph::EdgeIterator ei = bb->cfg.incident(); !ei.end(); ei.next()) {
-      pb = pn = BasicBlock::get(ei.getNode());
+      pb = BasicBlock::get(ei.getNode());
       assert(pb);
-
-      if (needNewElseBlock(bb, pb)) {
-         pn = new BasicBlock(func);
-
-         // deletes an edge, iterator is invalid after this:
-         pb->cfg.detach(&bb->cfg);
-         pb->cfg.attach(&pn->cfg, Graph::Edge::TREE);
-         pn->cfg.attach(&bb->cfg, Graph::Edge::FORWARD); // XXX: check order !
-
-         assert(pb->getExit()->op != OP_CALL);
-         if (pb->getExit()->asFlow()->target.bb == bb)
-            pb->getExit()->asFlow()->target.bb = pn;
-         break;
-      }
+      if (needNewElseBlock(bb, pb))
+         stack.push(pb);
+   }
+   while (!stack.empty()) {
+      pb = stack.top();
+      pn = new BasicBlock(func);
+      stack.pop();
+
+      pb->cfg.detach(&bb->cfg);
+      pb->cfg.attach(&pn->cfg, Graph::Edge::TREE);
+      pn->cfg.attach(&bb->cfg, Graph::Edge::FORWARD);
+
+      assert(pb->getExit()->op != OP_CALL);
+      if (pb->getExit()->asFlow()->target.bb == bb)
+         pb->getExit()->asFlow()->target.bb = pn;
    }

    // insert MOVs (phi->src(j) should stem from j-th in-BB)

which the patch in attachment 116339 effectively undoes. [Why was that in
there? No idea. But presumably futzing with bb's affects needNewElseBlock's
decisions.] So I'm still tending towards my solution. But I'm not particularly
happy that it has to build up and use that hash table every time even if
nothing's changed.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3140 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2015-06-28  6:17 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 19:32 [Bug 90887] New: PhiMovesPass in register allocator broken bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found] ` <bug-90887-8800-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-06-07 19:36   ` [Bug 90887] " bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-07 19:42   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-07 20:33   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-16 11:28   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17  4:44   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 14:06   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 15:40   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 18:59   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-17 23:32   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 18:13   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 19:19   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-18 20:52   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-22 12:24   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  6:17   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ [this message]
2015-06-28  6:23   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  6:25   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  7:51   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-28  8:37   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-29 21:43   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-06-29 23:06   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-07-12 18:41   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 18:35   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 20:20   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 20:21   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:16   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:23   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 22:45   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-20 23:34   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21  0:03   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 20:34   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 20:39   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 21:53   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 21:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-21 22:24   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 14:16   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 15:08   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 20:15   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-08-22 22:41   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-09-10  7:17   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2015-12-07 19:50   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found]     ` <bug-90887-8800-19WTPVxGXI-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-12-07 19:57       ` Craig Garner
2015-12-07 19:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
     [not found]     ` <bug-90887-8800-goEQduK9MX-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2015-12-07 20:04       ` Craig Garner

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-90887-8800-oaNAxwKWzx@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon-cc+yj3umiyqdupfqwhejaq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.