Mesa (master): nv50/ir: make sure cfg iterator always hits all blocks

Ilia Mirkin imirkin at kemper.freedesktop.org
Tue Aug 23 22:32:40 UTC 2016


Module: Mesa
Branch: master
Commit: 092f994a034b718f6170c631655ccaba8d2aa768
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=092f994a034b718f6170c631655ccaba8d2aa768

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Aug 19 00:41:59 2016 -0400

nv50/ir: make sure cfg iterator always hits all blocks

In some very specially-crafted cases, we could attempt to visit a node
that has already been visited, and then run out of bb's to visit, while
there were still cross blocks on the list. Make sure that those get
moved over in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96274
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Cc: mesa-stable at lists.freedesktop.org

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp
index 23414d5..b1076cf 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp
@@ -287,7 +287,10 @@ private:
 
       bb.push(node);
 
-      while (bb.getSize()) {
+      while (bb.getSize() || cross.getSize()) {
+         if (bb.getSize() == 0)
+            cross.moveTo(bb);
+
          node = reinterpret_cast<Graph::Node *>(bb.pop().u.p);
          assert(node);
          if (!node->visit(sequence))
@@ -314,9 +317,6 @@ private:
             }
          }
          nodes[count++] = node;
-
-         if (bb.getSize() == 0)
-            cross.moveTo(bb);
       }
    }
 




More information about the mesa-commit mailing list