Mesa (master): glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()

Bryan Cain bryanc at kemper.freedesktop.org
Mon Jan 2 20:10:26 UTC 2012


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

Author: Bryan Cain <bryancain3 at gmail.com>
Date:   Mon Jan  2 14:07:38 2012 -0600

glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 77aa0d1..1515fc1 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3505,10 +3505,15 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
       switch (inst->op) {
       case TGSI_OPCODE_BGNLOOP:
       case TGSI_OPCODE_ENDLOOP:
+      case TGSI_OPCODE_CONT:
+      case TGSI_OPCODE_BRK:
          /* End of a basic block, clear the write array entirely.
-          * FIXME: This keeps us from killing dead code when the writes are
+          *
+          * This keeps us from killing dead code when the writes are
           * on either side of a loop, even when the register isn't touched
-          * inside the loop.
+          * inside the loop.  However, glsl_to_tgsi_visitor doesn't seem to emit
+          * dead code of this type, so it shouldn't make a difference as long as
+          * the dead code elimination pass in the GLSL compiler does its job.
           */
          memset(writes, 0, sizeof(*writes) * this->next_temp * 4);
          break;




More information about the mesa-commit mailing list