Mesa (7.9): glsl: Remove "discard" support from lower_jumps.

Ian Romanick idr at kemper.freedesktop.org
Thu Dec 16 23:08:34 UTC 2010


Module: Mesa
Branch: 7.9
Commit: cefccebd89a26777a3022a11af80f090fdf9796f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cefccebd89a26777a3022a11af80f090fdf9796f

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Nov 29 10:59:16 2010 -0800

glsl: Remove "discard" support from lower_jumps.

The new lower_discard and opt_discard_simplification passes should
handle all the necessary transformations, so lower_jumps doesn't need to
support it.

Also, lower_jumps incorrectly handled conditional discards - it would
unconditionally truncate all code after the discard.  Rather than fixing
the bug, simply remove the code.

NOTE: This is a candidate for the 7.9 branch.

---

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

diff --git a/src/glsl/ir_lower_jumps.cpp b/src/glsl/ir_lower_jumps.cpp
index b69cc1e..a86417c 100644
--- a/src/glsl/ir_lower_jumps.cpp
+++ b/src/glsl/ir_lower_jumps.cpp
@@ -36,7 +36,6 @@ enum jump_strength
    strength_continue,
    strength_break,
    strength_return,
-   strength_discard
 };
 
 struct block_record
@@ -202,8 +201,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
 
    virtual void visit(class ir_discard * ir)
    {
-      truncate_after_instruction(ir);
-      this->block.min_strength = strength_discard;
    }
 
    enum jump_strength get_jump_strength(ir_instruction* ir)
@@ -217,8 +214,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
             return strength_continue;
       } else if(ir->ir_type == ir_type_return)
          return strength_return;
-      else if(ir->ir_type == ir_type_discard)
-         return strength_discard;
       else
          return strength_none;
    }
@@ -253,9 +248,6 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
          else
             lower = lower_sub_return;
          break;
-      case strength_discard:
-         lower = false; /* probably nothing needs this lowered */
-         break;
       }
       return lower;
    }
@@ -313,9 +305,8 @@ retry: /* we get here if we put code after the if inside a branch */
             /* FINISHME: unify returns with identical expressions */
             else if(jump_strengths[0] == strength_return && this->function.signature->return_type->is_void())
                ir->insert_after(new(ir) ir_return(NULL));
-            /* FINISHME: unify discards */
-            else
-               unify = false;
+	    else
+	       unify = false;
 
             if(unify) {
                jumps[0]->remove();




More information about the mesa-commit mailing list