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

Author: Paul Berry <stereotype...@gmail.com>
Date:   Mon Apr 22 14:02:00 2013 -0700

glsl: Teach basic block analysis about break/continue/discard.

Previously, the only kind of ir_jump that would terminate a basic
block was "return".  However, the other possible types of ir_jump
("break", "continue", and "discard") should terminate a basic block
too.  This patch modifies basic block analysis so that it terminates a
basic block on any type of ir_jump, not just ir_return.

Fixes piglit test dead-code-break-interaction.shader_test.

Reviewed-by: Matt Turner <matts...@gmail.com>
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

---

 src/glsl/ir_basic_block.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ir_basic_block.cpp b/src/glsl/ir_basic_block.cpp
index 86e0cf7..2cbc682 100644
--- a/src/glsl/ir_basic_block.cpp
+++ b/src/glsl/ir_basic_block.cpp
@@ -77,7 +77,7 @@ void call_for_basic_blocks(exec_list *instructions,
         callback(leader, ir, data);
         leader = NULL;
         call_for_basic_blocks(&ir_loop->body_instructions, callback, data);
-      } else if (ir->as_return() || ir->as_call()) {
+      } else if (ir->as_jump() || ir->as_call()) {
         callback(leader, ir, data);
         leader = NULL;
       } else if ((ir_function = ir->as_function())) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to